Package tv.ustream.yolo.config

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


    public void processShouldUseCustomTimestamp()
    {
        Map<String, Object> parserOutput = new HashMap<String, Object>();
        parserOutput.put("ts", "1234567890");

        processor.process(parserOutput, createProcessParams("key", 5D, 1D, new ConfigPattern("#ts#")));

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

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

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

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

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

    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(key, 1D));

        verifyNoMoreInteractions(graphiteClient);
    }
View Full Code Here

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

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

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

        verifyNoMoreInteractions(graphiteClient);
    }
View Full Code Here

TOP

Related Classes of tv.ustream.yolo.config.ConfigPattern

Copyright © 2018 www.massapicom. 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.