Search in sources :

Example 1 with TimeSeries

use of org.apache.jackrabbit.api.stats.TimeSeries in project jackrabbit-oak by apache.

the class DefaultStatisticsProviderTest method getRegisteredTimeSeries.

private Set<String> getRegisteredTimeSeries(DefaultStatisticsProvider statsProvider) {
    RepositoryStatisticsImpl stats = (RepositoryStatisticsImpl) statsProvider.getStats();
    Set<String> names = new HashSet<String>();
    for (Map.Entry<String, TimeSeries> e : stats) {
        names.add(e.getKey());
    }
    return names;
}
Also used : TimeSeries(org.apache.jackrabbit.api.stats.TimeSeries) RepositoryStatisticsImpl(org.apache.jackrabbit.stats.RepositoryStatisticsImpl) Map(java.util.Map) HashSet(java.util.HashSet)

Example 2 with TimeSeries

use of org.apache.jackrabbit.api.stats.TimeSeries in project jackrabbit-oak by apache.

the class SimpleStatsTest method noopRepoStatsTest.

@Test
public void noopRepoStatsTest() throws Exception {
    RepositoryStatistics stats = StatisticsProvider.NOOP.getStats();
    assertNotNull(stats);
    assertNotNull(stats.getTimeSeries("foo", false));
    assertNotNull(stats.getTimeSeries(RepositoryStatistics.Type.QUERY_COUNT));
    TimeSeries ts = stats.getTimeSeries("foo", false);
    assertNotNull(ts.getValuePerHour());
    assertNotNull(ts.getValuePerMinute());
    assertNotNull(ts.getValuePerSecond());
    assertNotNull(ts.getValuePerWeek());
    assertEquals(0, ts.getMissingValue());
}
Also used : TimeSeries(org.apache.jackrabbit.api.stats.TimeSeries) RepositoryStatistics(org.apache.jackrabbit.api.stats.RepositoryStatistics) Test(org.junit.Test)

Aggregations

TimeSeries (org.apache.jackrabbit.api.stats.TimeSeries)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 RepositoryStatistics (org.apache.jackrabbit.api.stats.RepositoryStatistics)1 RepositoryStatisticsImpl (org.apache.jackrabbit.stats.RepositoryStatisticsImpl)1 Test (org.junit.Test)1