/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }
/** * * @param invocation */ void addInvocation(Invocation invocation) { if (!invocation.isEntryPoint()) { throw new IllegalStateException("Invocation is not an entry point!"); } // Remove some old data if the limit is exceeded if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { synchronized (this) { if (invocations.size() > DEFAULT_INVOCATIONS_LIMIT) { Set<Integer> keySet = invocations.keySet(); List<Integer> sorted = new ArrayList<Integer>(keySet); Collections.sort(sorted, Collections.reverseOrder()); if (keySet.removeAll(sorted.subList(DEFAULT_INVOCATIONS_LIMIT / 2, sorted.size()))) { ProbeLogger.LOG.monitoringLimitExceeded(Invocation.class.getSimpleName(), DEFAULT_INVOCATIONS_LIMIT); } } } } invocations.put(invocation.getEntryPointIdx(), invocation); }