Examples of ConfigPattern


Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldAddParamsToKey()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("p1", "v1");

        ConfigPattern key = new ConfigPattern("some.#p1#.key");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), key, 5D));

        verify(statsDClient).count("some.v1.key", 5);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldUseValueFromParameters()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("v1", "5");

        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), "key", value));

        verify(statsDClient).count("key", 5);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("p1", "v1");
        parserOutput.put("v1", "5");

        ConfigPattern key = new ConfigPattern("some.#p1#.key");
        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), key, value));

        verify(statsDClient).count("some.v1.key", 5);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    {
        Map<String, Object> params = new HashMap<String, Object>();

        Map<String, Object> key1 = new HashMap<String, Object>();
        key1.put("type", "gauge");
        key1.put("key", new ConfigPattern("some.#p1#.key"));
        key1.put("value", 1D);
        key1.put("multiplier", 1D);

        Map<String, Object> key2 = new HashMap<String, Object>();
        key2.put("type", "timer");
        key2.put("key", new ConfigPattern("someother.#p1#.key"));
        key2.put("value", 2D);
        key2.put("multiplier", 1D);

        params.put("keys", Arrays.<Map>asList(key1, key2));
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldHandleByteValues()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("v1", "5M");

        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), "key", value));

        verify(statsDClient).count("key", 5 * 1024 * 1024);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldNotSendWhenKeyParamIsMissing()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("p2", "key");

        ConfigPattern key = new ConfigPattern("some.#p1#.key");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), key, 1D));

        verifyNoMoreInteractions(statsDClient);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldNotSendWhenValueParamIsMissing()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("v2", "5M");

        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createprocessParams(StatsDProcessor.Types.COUNTER.getValue(), "key", value));

        verifyNoMoreInteractions(statsDClient);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldAddParamsToKey()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("p1", "v1");

        ConfigPattern key = new ConfigPattern("some.#p1#.key");

        processor.process(parserOutput, createProcessParams(key, 5D));

        verify(graphiteClient).sendMetrics("some.v1.key", 5D);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    public void processShouldUseValueFromParameters()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("v1", "5");

        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createProcessParams("key", value));

        verify(graphiteClient).sendMetrics("key", 5D);
    }
View Full Code Here

Examples of tv.ustream.yolo.config.ConfigPattern

    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("p1", "v1");
        parserOutput.put("v1", "5");

        ConfigPattern key = new ConfigPattern("some.#p1#.key");
        ConfigPattern value = new ConfigPattern("#v1#");

        processor.process(parserOutput, createProcessParams(key, value));

        verify(graphiteClient).sendMetrics("some.v1.key", 5D);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.