@Test public void testRemoveRequest() { final Counter counter = new Counter("error", null); counter.setMaxRequestsCount(1); final Collector collector = new Collector(TEST, Collections.singletonList(counter)); counter.addRequest("test 1", 0, 0, 0, false, 1000); counter.addRequest("test 2", 0, 0, 0, false, 1000); for (int i = 0; i < 50; i++) { counter.addRequest("test 3", 0, 0, 0, false, 1000); } collector.collectWithoutErrors(Collections.<JavaInformations> emptyList()); if (counter.getRequestsCount() > 1) { fail("removeRequest"); } counter.addRequest("test 1", 0, 0, 0, false, 1000); counter.addRequest("test 2", 0, 0, 0, false, 1000); collector.collectWithoutErrors(Collections.<JavaInformations> emptyList()); if (counter.getRequestsCount() > 1) { fail("removeRequest"); } for (int i = 0; i < counter.getMaxRequestsCount() * 2; i++) { counter.addRequest("test 1", 0, 0, 0, false, 1000); } for (int i = 0; i <= 10; i++) { counter.addRequest("test 2", 0, 0, 0, false, 1000); } counter.addRequest("test 3", 0, 0, 0, false, 1000); counter.addRequest("test 4", 0, 0, 0, false, 1000); collector.collectWithoutErrors(Collections.<JavaInformations> emptyList()); if (counter.getRequestsCount() > 1) { fail("removeRequest"); } }
private void removeRequest(Counter counter, CounterRequest newRequest) { counter.removeRequest(newRequest.getName()); requestsById.remove(newRequest.getId()); final JRobin requestJRobin = requestJRobinsById.remove(newRequest.getId()); if (requestJRobin != null) { requestJRobin.deleteFile(); } }
Collector { private void removeRequest(Counter counter, CounterRequest newRequest) { counter.removeRequest(newRequest.getName()); requestsById.remove(newRequest.getId()); final JRobin requestJRobin = requestJRobinsById.remove(newRequest.getId()); if (requestJRobin != null) { requestJRobin.deleteFile(); } } }
Collector { private void removeRequest(Counter counter, CounterRequest newRequest) { counter.removeRequest(newRequest.getName()); requestsById.remove(newRequest.getId()); final JRobin requestJRobin = requestJRobinsById.remove(newRequest.getId()); if (requestJRobin != null) { requestJRobin.deleteFile(); } } Collector(String application, List<Counter> counters);  Collector(String application, List<Counter> counters,
			SamplingProfiler samplingProfiler); }
Collector { private void removeRequest(Counter counter, CounterRequest newRequest) { counter.removeRequest(newRequest.getName()); requestsById.remove(newRequest.getId()); final JRobin requestJRobin = requestJRobinsById.remove(newRequest.getId()); if (requestJRobin != null) { requestJRobin.deleteFile(); } } 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 { private void removeRequest(Counter counter, CounterRequest newRequest) { counter.removeRequest(newRequest.getName()); requestsById.remove(newRequest.getId()); final JRobin requestJRobin = requestJRobinsById.remove(newRequest.getId()); if (requestJRobin != null) { requestJRobin.deleteFile(); } } 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();  }