Package org.apache.sirona

Examples of org.apache.sirona.Role


    }

    public CounterGauge(final Counter counter, final MetricData metric) {
        this.counter = counter;
        this.metric = metric;
        this.role = new Role("counter-" + counter.getKey().getRole().getName() + "-" + counter.getKey().getName() + "-" + metric.name(), Unit.UNARY);
    }
View Full Code Here


    private final Role role;

    public JMXAttributeGaugeBase(final ObjectName name, final String attribute, final String role, final Unit unit) {
        this.name = name;
        this.attribute = attribute;
        this.role = new Role(role, unit);
    }
View Full Code Here

    }

    @Override
    public Role findGaugeRole(final String name) {
        for (final GaugeDataStore store : dataStores.values()) {
            final Role role = store.findGaugeRole(name);
            if (role != null) {
                return role;
            }
        }
        return null;
View Full Code Here

        Repository.INSTANCE.clearCounters();
    }

    @Test
    public void counterStore() {
        final Counter.Key key = new Counter.Key(new Role("r", Unit.UNARY), "n");

        // note: the input data are maybe not that consistent (min > max) but this test just checks computations
        final CollectorCounterStore store = new InMemoryCollectorCounterStore();
        store.update(key, "client1", new M2AwareStatisticalSummary(1, 2, 5, 0, 10, 6, 7), 4);
        store.update(key, "client2", new M2AwareStatisticalSummary(2, 4, 8, 1, 15, 9, 5), 2);
View Full Code Here

        repo.addGauge(new Gauge() {
            public int value = 0;

            @Override
            public Role role() {
                return new Role("gaugerole", Unit.UNARY);
            }

            @Override
            public double value() {
                return value++;
View Full Code Here

        Repository.INSTANCE.clearCounters();
    }

    @Test
    public void gaugeStore() {
        final Role role = new Role("gauge", Unit.UNARY);

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

            return counters;
        }

        for (final HColumn<String, String> colum : qResult.get().getColumns()) {
            final String[] segments = colum.getName().split(cassandra.keySeparator());
            final Counter.Key ckey = new Counter.Key(new Role(segments[0], Unit.get(segments[1])), segments[2]);
            counters.add(findByKey(ckey, marker));
        }

        return counters;
    }
View Full Code Here

        final StatusGauge gauge = gauges.get(status);
        if (gauge != null) {
            return gauge;
        }

        final StatusGauge newGauge = new StatusGauge(new Role(prefix + "-HTTP-" + Integer.toString(status), Unit.UNARY));
        final StatusGauge old = gauges.putIfAbsent(status, newGauge);
        if (old != null) {
            return old;
        }
        return newGauge;
View Full Code Here

    public void contextInitialized(final ServletContextEvent sce) {
        String contextPath = sce.getServletContext().getContextPath();
        if (contextPath == null || contextPath.isEmpty()) {
            contextPath = "/";
        }
        counter = Repository.INSTANCE.getCounter(new Counter.Key(new Role("session-durations", Unit.Time.NANOSECOND), "session-durations-" + contextPath));

        gauge = new SessionGauge(contextPath, sessionNumber);
        Repository.INSTANCE.addGauge(gauge);
    }
View Full Code Here

    }

    @Override
    protected void pushGauges(final Map<Role, Measure> gauges) {
        for (final Map.Entry<Role, Measure> entry : gauges.entrySet()) {
            final Role role = entry.getKey();
            final Measure measure = entry.getValue();

            delegate.createOrNoopGauge(role, marker);
            delegate.addToGauge(role, measure.getTime(), measure.getValue(), marker);
        }
View Full Code Here

TOP

Related Classes of org.apache.sirona.Role

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.