/** * Retrieves all the records managed by this MetricsContext. * Useful for monitoring systems that are polling-based. * @return A non-null collection of all monitoring records. */ public synchronized Map<String, Collection<OutputRecord>> getAllRecords() { Map<String, Collection<OutputRecord>> out = new TreeMap<String, Collection<OutputRecord>>(); for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { List<OutputRecord> records = new ArrayList<OutputRecord>(); Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet(); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); records.add(outRec); } out.put(recordEntry.getKey(), records); } } return out; }
/** * Retrieves all the records managed by this MetricsContext. * Useful for monitoring systems that are polling-based. * @return A non-null collection of all monitoring records. */ @Override public synchronized Map<String, Collection<OutputRecord>> getAllRecords() { Map<String, Collection<OutputRecord>> out = new TreeMap<String, Collection<OutputRecord>>(); for (String recordName : bufferedData.keySet()) { RecordMap recordMap = bufferedData.get(recordName); synchronized (recordMap) { List<OutputRecord> records = new ArrayList<OutputRecord>(); Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet(); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); records.add(outRec); } out.put(recordName, records); } } return out; } }
/** * Retrieves all the records managed by this MetricsContext. * Useful for monitoring systems that are polling-based. * @return A non-null collection of all monitoring records. */ public synchronized Map<String, Collection<OutputRecord>> getAllRecords() { Map<String, Collection<OutputRecord>> out = new TreeMap<String, Collection<OutputRecord>>(); for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { List<OutputRecord> records = new ArrayList<OutputRecord>(); Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet(); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); records.add(outRec); } out.put(recordEntry.getKey(), records); } } return out; }
/** * Retrieves all the records managed by this MetricsContext. * Useful for monitoring systems that are polling-based. * @return A non-null collection of all monitoring records. */ public synchronized Map<String, Collection<OutputRecord>> getAllRecords() { Map<String, Collection<OutputRecord>> out = new TreeMap<String, Collection<OutputRecord>>(); for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { List<OutputRecord> records = new ArrayList<OutputRecord>(); Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet(); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); records.add(outRec); } out.put(recordEntry.getKey(), records); } } return out; }
/** * Retrieves all the records managed by this MetricsContext. * Useful for monitoring systems that are polling-based. * @return A non-null collection of all monitoring records. */ public synchronized Map<String, Collection<OutputRecord>> getAllRecords() { Map<String, Collection<OutputRecord>> out = new TreeMap<String, Collection<OutputRecord>>(); for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { List<OutputRecord> records = new ArrayList<OutputRecord>(); Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet(); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); records.add(outRec); } out.put(recordEntry.getKey(), records); } } return out; }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (Entry<String, RecordMap> record : bufferedData.entrySet()) { String recordName = record.getKey(); RecordMap recordMap = record.getValue(); for (Entry<TagMap, MetricMap> entry : record.getValue().entrySet()) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordName, outRec); } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet (); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordEntry.getKey(), outRec); } } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet (); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordEntry.getKey(), outRec); } } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet (); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordEntry.getKey(), outRec); } } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (Map.Entry<String,RecordMap> recordEntry : bufferedData.entrySet()) { RecordMap recordMap = recordEntry.getValue(); synchronized (recordMap) { Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet (); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordEntry.getKey(), outRec); } } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (String recordName : bufferedData.keySet()) { RecordMap recordMap = bufferedData.get(recordName); synchronized (recordMap) { Set<Entry<TagMap, MetricMap>> entrySet = recordMap.entrySet (); for (Entry<TagMap, MetricMap> entry : entrySet) { OutputRecord outRec = new OutputRecord(entry.getKey(), entry.getValue()); emitRecord(contextName, recordName, outRec); } } } flush(); }
/** * Emits the records. */ private synchronized void emitRecords() throws IOException { for (String recordName : bufferedData.keySet()) { RecordMap recordMap = bufferedData.get(recordName); synchronized (recordMap) { for (TagMap tagMap : recordMap.keySet()) { MetricMap metricMap = recordMap.get(tagMap); OutputRecord outRec = new OutputRecord(tagMap, metricMap); emitRecord(contextName, recordName, outRec); } } } flush(); }
public void testCopy() { TagMap tags = new TagMap(); tags.put("tagkey", "tagval"); MetricMap metrics = new MetricMap(); metrics.put("metrickey", 123.4); OutputRecord r = new OutputRecord(tags, metrics); assertEquals(tags, r.getTagsCopy()); assertNotSame(tags, r.getTagsCopy()); assertEquals(metrics, r.getMetricsCopy()); assertNotSame(metrics, r.getMetricsCopy()); } }
public void testCopy() { TagMap tags = new TagMap(); tags.put("tagkey", "tagval"); MetricMap metrics = new MetricMap(); metrics.put("metrickey", 123.4); OutputRecord r = new OutputRecord(tags, metrics); assertEquals(tags, r.getTagsCopy()); assertNotSame(tags, r.getTagsCopy()); assertEquals(metrics, r.getMetricsCopy()); assertNotSame(metrics, r.getMetricsCopy()); } }
public void testCopy() { TagMap tags = new TagMap(); tags.put("tagkey", "tagval"); MetricMap metrics = new MetricMap(); metrics.put("metrickey", 123.4); OutputRecord r = new OutputRecord(tags, metrics); assertEquals(tags, r.getTagsCopy()); assertNotSame(tags, r.getTagsCopy()); assertEquals(metrics, r.getMetricsCopy()); assertNotSame(metrics, r.getMetricsCopy()); } }