@Test public void testGetRangeCountersToBeDisplayed() throws IOException { final Counter counter = createCounter(); final Collector collector = new Collector(TEST, Collections.singletonList(counter)); if (collector.getCounters().size() == 0) { fail("getCounters"); } final JavaInformations javaInformations = new JavaInformations(null, true); final List<JavaInformations> javaInformationsList = Collections .singletonList(javaInformations); counter.addRequest("test1", 0, 0, 0, false, 1000); collector.collectWithoutErrors(javaInformationsList); counter.addRequest("test1", 0, 0, 0, false, 1000); collector.collectWithoutErrors(javaInformationsList); collector.collectWithoutErrors(javaInformationsList); assertEquals("jour", 1, getSizeOfCountersToBeDisplayed(collector, Period.JOUR)); assertEquals("semaine", 1, getSizeOfCountersToBeDisplayed(collector, Period.SEMAINE)); assertEquals("mois", 1, getSizeOfCountersToBeDisplayed(collector, Period.MOIS)); assertEquals("année", 1, getSizeOfCountersToBeDisplayed(collector, Period.ANNEE)); assertEquals("tout", 1, getSizeOfCountersToBeDisplayed(collector, Period.TOUT)); assertEquals("custom", 1, collector .getRangeCountersToBeDisplayed(Range.createCustomRange(new Date(), new Date())) .size()); }
public List<Counter> getRangeCountersToBeDisplayed(Range range) throws IOException { final List<Counter> result = new ArrayList<Counter>(getRangeCounters(range)); final Iterator<Counter> it = result.iterator(); while (it.hasNext()) { final Counter counter = it.next(); if (!counter.isDisplayed() || counter.isJobCounter()) { it.remove(); } } return Collections.unmodifiableList(result); }
Collector { public List<Counter> getRangeCountersToBeDisplayed(Range range) throws IOException { final List<Counter> result = new ArrayList<Counter>(getRangeCounters(range)); final Iterator<Counter> it = result.iterator(); while (it.hasNext()) { final Counter counter = it.next(); if (!counter.isDisplayed() || counter.isJobCounter()) { it.remove(); } } return Collections.unmodifiableList(result); } }
Collector { public List<Counter> getRangeCountersToBeDisplayed(Range range) throws IOException { final List<Counter> result = new ArrayList<Counter>(getRangeCounters(range)); final Iterator<Counter> it = result.iterator(); while (it.hasNext()) { final Counter counter = it.next(); if (!counter.isDisplayed() || counter.isJobCounter()) { it.remove(); } } return Collections.unmodifiableList(result); } Collector(String application, List<Counter> counters);  Collector(String application, List<Counter> counters,
			SamplingProfiler samplingProfiler); }
Collector { public List<Counter> getRangeCountersToBeDisplayed(Range range) throws IOException { final List<Counter> result = new ArrayList<Counter>(getRangeCounters(range)); final Iterator<Counter> it = result.iterator(); while (it.hasNext()) { final Counter counter = it.next(); if (!counter.isDisplayed() || counter.isJobCounter()) { it.remove(); } } return Collections.unmodifiableList(result); } Collector(String application, List<Counter> counters);  Collector(String application, List<Counter> counters,
			SamplingProfiler samplingProfiler); String getApplication(); SamplingProfiler getSamplingProfiler(); List<SampledMethod> getHotspots(); Map<String, Date> getDatesByWebappVersions(); List<Counter> getCounters(); Counter getCounterByName(String counterName); Counter getCounterByRequestId(CounterRequest request); List<CounterRequestContext> getRootCurrentContexts(List<Counter> newParentCounters); long getLastCollectDuration(); Throwable getLastCollectorException(); long getEstimatedMemorySize(); long getDiskUsage(); List<Counter> getRangeCounters(Range range); List<Counter> getRangeCountersToBeDisplayed(Range range); Counter getRangeCounter(Range range, String counterName); void collectLocalContextWithoutErrors(); void collectWithoutErrors(List<JavaInformations> javaInformationsList); JRobin getJRobin(String graphName); Collection<JRobin> getCounterJRobins(); Collection<JRobin> getDisplayedCounterJRobins(); Collection<JRobin> getDisplayedOtherJRobins(); boolean isStorageUsedByMultipleInstances(); void stop(); boolean isStopped(); static void stopJRobin(); static void detachVirtualMachine(); @Override String toString(); }
Collector { public List<Counter> getRangeCountersToBeDisplayed(Range range) throws IOException { final List<Counter> result = new ArrayList<Counter>(getRangeCounters(range)); final Iterator<Counter> it = result.iterator(); while (it.hasNext()) { final Counter counter = it.next(); if (!counter.isDisplayed() || counter.isJobCounter()) { it.remove(); } } return Collections.unmodifiableList(result); } Collector(String application, List<Counter> counters);  Collector(String application, List<Counter> counters,
			SamplingProfiler samplingProfiler); String getApplication(); SamplingProfiler getSamplingProfiler(); List<SampledMethod> getHotspots(); Map<String, Date> getDatesByWebappVersions(); List<Counter> getCounters(); Counter getCounterByName(String counterName); Counter getCounterByRequestId(CounterRequest request); List<CounterRequestContext> getRootCurrentContexts(List<Counter> newParentCounters); long getLastCollectDuration(); Throwable getLastCollectorException(); long getEstimatedMemorySize(); long getDiskUsage(); List<Counter> getRangeCounters(Range range); List<Counter> getRangeCountersToBeDisplayed(Range range); Counter getRangeCounter(Range range, String counterName); void collectLocalContextWithoutErrors(); void collectWithoutErrors(List<JavaInformations> javaInformationsList); JRobin getJRobin(String graphName); Collection<JRobin> getCounterJRobins(); Collection<JRobin> getDisplayedCounterJRobins(); Collection<JRobin> getDisplayedOtherJRobins(); boolean isStorageUsedByMultipleInstances(); void stop(); boolean isStopped(); static void stopJRobin(); static void detachVirtualMachine(); @Override String toString();  }