Package org.apache.sirona

Examples of org.apache.sirona.Role


        assertEquals(1, hitCounter.getHits());
    }

    @Test
    public void knownStatusIsMonitored() throws IOException, InterruptedException {
        final Role role = new Role("/sirona-test-HTTP-200", Unit.UNARY);
        final int before = statusGaugeSum(role);
        final TextPage page = newClient().getPage(base.toExternalForm() + "hit");
        assertEquals(HttpURLConnection.HTTP_OK, page.getWebResponse().getStatusCode());
        Thread.sleep(1000);
        assertEquals("" + Repository.INSTANCE.getGaugeValues(0, System.currentTimeMillis() + 1000, role), 1, statusGaugeSum(role) - before);
View Full Code Here


    @Test
    public void unknownStatusIsIgnored() throws IOException, InterruptedException {
        final TextPage page = newClient().getPage(base.toExternalForm() + "hit?status=4567");
        assertEquals(4567, page.getWebResponse().getStatusCode());
        Thread.sleep(1000);
        assertEquals(0, statusGaugeSum(new Role("/sirona-test-HTTP-4567", Unit.UNARY)));
    }
View Full Code Here

        return cassandra.generateKey(role.getName(), role.getUnit().getName(), marker);
    }

    private Role keyToRole(final String key) {
        final String[] segments = key.split(cassandra.keySeparator());
        return new Role(segments[0], Unit.get(segments[1]))// no need of segments[2] (= marker)
    }
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

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.