Package com.netflix.servo.tag

Examples of com.netflix.servo.tag.TagList


    }

    /** {@inheritDoc} */
    public boolean matches(MonitorConfig config) {
        String name = config.getName();
        TagList tags = config.getTags();
        String value;
        if (tagKey == null) {
            value = name;
        } else {
            Tag t = tags.getTag(tagKey);
            value = (t == null) ? null : t.getValue();
        }

        if (Strings.isNullOrEmpty(value)) {
            return root.matches(config);
View Full Code Here


    private static final String JMX_DOMAIN_KEY = "JmxDomain";

    @Override
    public String getName(Metric metric) {
        MonitorConfig config = metric.getConfig();
        TagList tags = config.getTags();

        Tag domainTag = tags.getTag(JMX_DOMAIN_KEY);
        if (domainTag != null) { // jmx metric
            return handleJmxMetric(config, tags);
        } else {
            return handleMetric(config, tags);
        }
View Full Code Here

        assertEquals(name, "simpleMonitor");
    }

    @Test
    public void testMetricNamingWithTags() throws Exception {
        TagList tagList = BasicTagList.of("instance", "GetLogs", DataSourceType.KEY,
                "HystrixCommand");

        Metric m = new Metric("simpleMonitor", tagList, 0, 1000.0);

        GraphiteNamingConvention convention = new BasicGraphiteNamingConvention();
View Full Code Here

            final Counter c1 = Monitors.newCounter("publicCounter");
            @com.netflix.servo.annotations.Monitor(
                name = "primitiveGauge", type = DataSourceType.GAUGE)
            static final long A1 = 0L;
        };
        TagList tags = SortedTagList.builder().withTag("abc", "def").build();
        Monitors.addMonitors(monitors, null, tags, obj);

        assertEquals(monitors.size(), 10);
        for (Monitor m : monitors) {
            assertEquals(m.getConfig().getTags().getValue("class"), "MonitorsTest",
View Full Code Here

    @Test
    public void testAddMonitorFields() throws Exception {
        List<Monitor<?>> monitors = Lists.newArrayList();
        ClassWithMonitors obj = new ClassWithMonitors();

        TagList tags = SortedTagList.builder().withTag("abc", "def").build();

        Monitors.addMonitorFields(monitors, null, tags, obj, obj.getClass());
        Monitors.addMonitorFields(monitors, "foo", null, obj, obj.getClass());
        //System.out.println(monitors);
        assertEquals(monitors.size(), 8);
View Full Code Here

            if (i % 2 == 0) {
                dummy.method2(i);
            }
        }

        final TagList tagList = BasicTagList.of(
                TimedInterface.CLASS_TAG, "DummyImpl",
                TimedInterface.INTERFACE_TAG, "IDummy",
                TimedInterface.ID_TAG, "id");
        final MonitorConfig expectedConfig = MonitorConfig.builder(TimedInterface.TIMED_INTERFACE)
                .withTags(tagList).build();
View Full Code Here

        // you'd register the CompositeMonitor as:
        DefaultMonitorRegistry.getInstance().register((CompositeMonitor) dummy);

        final CompositeMonitor<Long> compositeMonitor = (CompositeMonitor<Long>) dummy;
        final TagList tagList = BasicTagList.of(
                TimedInterface.CLASS_TAG, "DummyImpl",
                TimedInterface.INTERFACE_TAG, "IDummy");
        final MonitorConfig expectedConfig = MonitorConfig.builder(TimedInterface.TIMED_INTERFACE)
                .withTags(tagList).build();
        assertEquals(compositeMonitor.getConfig(), expectedConfig);
View Full Code Here

TOP

Related Classes of com.netflix.servo.tag.TagList

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.