Package org.apache.sirona.store.gauge

Examples of org.apache.sirona.store.gauge.GaugeValuesRequest


            } else {
                color = generateColor();
                COLORS.add(color);
            }

            final SortedMap<Long, Double> gaugeValues = gaugeStore.getGaugeValues(new GaugeValuesRequest(start, end, role), marker);
            builder.append(
                toJson(
                    label + " (" + marker + ")",
                    color,
                    aggregate(gaugeValues)
View Full Code Here


        return new CounterStopWatch(monitor);
    }

    @Override
    public SortedMap<Long, Double> getGaugeValues(final long start, final long end, final Role role) {
        return gaugeDataStore.getGaugeValues(new GaugeValuesRequest(start, end, role));
    }
View Full Code Here

        final Collection<Role> gauges = store.gauges();
        assertEquals(1, gauges.size());

        assertEquals(gauge.role(), gauges.iterator().next());
        final SortedMap<Long,Double> gaugeValues = store.getGaugeValues(new GaugeValuesRequest(0, System.currentTimeMillis(), Role.FAILURES));
        assertTrue(gaugeValues.size() > 0);
        assertEquals(5., gaugeValues.values().iterator().next(), 0.);

        store.gaugeStopped(gauge.role());
    }
View Full Code Here

        final CollectorGaugeDataStore store = new DelegatedCollectorGaugeDataStore();
        store.addToGauge(role, 1234, 5678, "client1");
        store.addToGauge(role, 987, 654, "client2");

        final GaugeValuesRequest request = new GaugeValuesRequest(0, Integer.MAX_VALUE, role);
        final Map<Long, Double> result = store.getGaugeValues(request);
        final Map<Long, Double> client1 = store.getGaugeValues(request, "client1");
        final Map<Long, Double> client2 = store.getGaugeValues(request, "client2");

        assertNotNull(result);
View Full Code Here

    @Test
    public void addToGaugesWithMarker() {
        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 1, 5, MARKER);
        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 2, 6, MARKER);

        final Map<Long, Double> values = new CassandraCollectorGaugeDataStore().getGaugeValues(new GaugeValuesRequest(0, 5, ROLE), MARKER);

        assertNotNull(values);
        assertEquals(2, values.size());
        assertEquals(5., values.get(1L), 0.);
        assertEquals(6., values.get(2L), 0.);
View Full Code Here

        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 1, 5, MARKER);
        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 2, 6, MARKER);
        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 1, 5, "node2");
        new CassandraCollectorGaugeDataStore().addToGauge(ROLE, 2, 6, "node2");

        final Map<Long, Double> values = new CassandraCollectorGaugeDataStore().getGaugeValues(new GaugeValuesRequest(0, 5, ROLE));

        assertNotNull(values);
        assertEquals(2, values.size());
        assertEquals(10., values.get(1L), 0.);
        assertEquals(12., values.get(2L), 0.);
View Full Code Here

            }
            doPost(events2);
        }

        final CollectorGaugeDataStore store = IoCs.getInstance(CollectorGaugeDataStore.class);
        final GaugeValuesRequest gaugeValuesRequest = new GaugeValuesRequest(0, System.currentTimeMillis() + 1000, new Role("event-role", Unit.UNARY));
        final Map<Long, Double> aggregated = store.getGaugeValues(gaugeValuesRequest);
        final Map<Long, Double> node1 = store.getGaugeValues(gaugeValuesRequest, "node1");
        final Map<Long, Double> node2 = store.getGaugeValues(gaugeValuesRequest, "node2");
        assertEquals(1, aggregated.size());
        assertTrue(aggregated.containsValue(20.));
View Full Code Here

        return new CounterStopWatch(monitor);
    }

    @Override
    public SortedMap<Long, Double> getGaugeValues(final long start, final long end, final Role role) {
        return gaugeDataStore.getGaugeValues(new GaugeValuesRequest(start, end, role));
    }
View Full Code Here

TOP

Related Classes of org.apache.sirona.store.gauge.GaugeValuesRequest

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.