@Override public Statistics getStatistics() { Statistics st = new Statistics(); synchronized (rate) { st.put("dataRate", new Double(rate.doubleValue())); } return st; }
public Statistics divideBy(String key) { Statistics st = new Statistics(); st.putAll(this); Double x = get(key); if (x == null || x == 0.0d) return st; for (String k : keySet()) { if (!k.equals(key)) { Double val = get(k); st.put(k, val / x); } } return st; }
@Override public Statistics getStatistics() { Statistics st = new Statistics(); synchronized (rate) { st.put("dataRate", new Double(rate.doubleValue())); } return st; }
public synchronized void substract(Map<String, Double> st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = -st.get(key); else d -= st.get(key); put(key, d); } }
@Override public Statistics getStatistics() { Statistics st = new Statistics(); st.put("dataRate", rate); return st; }
public synchronized void substract(Map<String, Double> st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = -st.get(key); else d -= st.get(key); put(key, d); } }
/** * Adds the given statistics vector to this instance. * * @param st */ public synchronized void add(Map<String, Double> st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = st.get(key); else d += st.get(key); put(key, d); } }
/** * Adds the given statistics vector to this instance. * * @param st */ public synchronized void add(Map<String, Double> st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = st.get(key); else d += st.get(key); put(key, d); } }
public synchronized void max(Map<String, Double> st) { List<String> keys = new LinkedList<String>(this.keySet()); for (String k : st.keySet()) if (!keys.contains(k)) keys.add(k); for (String key : keys) this.put(key, max(get(key), st.get(key))); }
public synchronized void max(Map<String, Double> st) { List<String> keys = new LinkedList<String>(this.keySet()); for (String k : st.keySet()) if (!keys.contains(k)) keys.add(k); for (String key : keys) this.put(key, max(get(key), st.get(key))); }
/** * @see stream.statistics.StatisticsService#getStatistics() */ @Override public Statistics getStatistics() { Statistics stats = new Statistics(); stats.put(key, memoryUsed.doubleValue()); return stats; }
/** * @see stream.statistics.StatisticsService#getStatistics() */ @Override public Statistics getStatistics() { Statistics stats = new Statistics(); stats.put(key, memoryUsed.doubleValue()); return stats; }
/** * @see stream.statistics.StatisticsService#getStatistics() */ @Override public Statistics getStatistics() { Statistics stats = new Statistics(); stats.put(key, memoryUsed.doubleValue()); return stats; }
public Statistics divideBy(Double val) { Statistics st = new Statistics(); for (String k : keySet()) st.put(k, get(k) / val); return st; }
public Statistics divideBy(Double val) { Statistics st = new Statistics(); for (String k : keySet()) st.put(k, get(k) / val); return st; }
public synchronized void add(Statistics st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = st.get(key); else d += st.get(key); put(key, d); } }
public synchronized void add(Statistics st) { for (String key : st.keySet()) { Double d = get(key); if (d == null) d = st.get(key); else d += st.get(key); put(key, d); } }
/** * @see stream.statistics.StatisticsService#getStatistics() */ @Override public Statistics getStatistics() { Statistics stats = new Statistics(); Double time = nanoTime.doubleValue(); Double items = itemsProcessed.doubleValue(); /* * Double rate = 0.0; if (time > 0.0d) { rate = items / time / 1000L; } */ stats.setName("Average Throughput"); stats.put("@avg:milliseconds-per-item", time / items); return stats; } }