@Override public void startMonitoring() throws IOException { for (MetricsContext ctxt : subctxt) { try { ctxt.startMonitoring(); } catch (IOException e) { LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e); } } }
@Override protected void flush() throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).flush(); } catch (IOException e) { LOG.warn("flush failed: " + ctxt.getContextName(), e); } } }
@Override protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).emitRecord( contextName, recordName, outRec); if (contextName == null || recordName == null || outRec == null) { throw new IOException(contextName + ":" + recordName + ":" + outRec); } } catch (IOException e) { LOG.warn("emitRecord failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void flush() throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).flush(); } catch (IOException e) { LOG.warn("flush failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override public void startMonitoring() throws IOException { for (MetricsContext ctxt : subctxt) { try { ctxt.startMonitoring(); } catch (IOException e) { LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void flush() throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).flush(); } catch (IOException e) { LOG.warn("flush failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override public void startMonitoring() throws IOException { for (MetricsContext ctxt : subctxt) { try { ctxt.startMonitoring(); } catch (IOException e) { LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override public void startMonitoring() throws IOException { for (MetricsContext ctxt : subctxt) { try { ctxt.startMonitoring(); } catch (IOException e) { LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void flush() throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).flush(); } catch (IOException e) { LOG.warn("flush failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).emitRecord( contextName, recordName, outRec); if (contextName == null || recordName == null || outRec == null) { throw new IOException(contextName + ":" + recordName + ":" + outRec); } } catch (IOException e) { LOG.warn("emitRecord failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).emitRecord( contextName, recordName, outRec); if (contextName == null || recordName == null || outRec == null) { throw new IOException(contextName + ":" + recordName + ":" + outRec); } } catch (IOException e) { LOG.warn("emitRecord failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).emitRecord( contextName, recordName, outRec); if (contextName == null || recordName == null || outRec == null) { throw new IOException(contextName + ":" + recordName + ":" + outRec); } } catch (IOException e) { LOG.warn("emitRecord failed: " + ctxt.getContextName(), e); } } }
/** * Collects all metric data, and returns a map: * contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ]. * The values are either String or Number. The final value is implemented * as a list of TagsMetricsPair. */ Map<String, Map<String, List<TagsMetricsPair>>> makeMap( Collection<MetricsContext> contexts) throws IOException { Map<String, Map<String, List<TagsMetricsPair>>> map = new TreeMap<String, Map<String, List<TagsMetricsPair>>>(); for (MetricsContext context : contexts) { Map<String, List<TagsMetricsPair>> records = new TreeMap<String, List<TagsMetricsPair>>(); map.put(context.getContextName(), records); for (Map.Entry<String, Collection<OutputRecord>> r : context.getAllRecords().entrySet()) { List<TagsMetricsPair> metricsAndTags = new ArrayList<TagsMetricsPair>(); records.put(r.getKey(), metricsAndTags); for (OutputRecord outputRecord : r.getValue()) { TagMap tagMap = outputRecord.getTagsCopy(); MetricMap metricMap = outputRecord.getMetricsCopy(); metricsAndTags.add(new TagsMetricsPair(tagMap, metricMap)); } } } return map; }
/** * Collects all metric data, and returns a map: * contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ]. * The values are either String or Number. The final value is implemented * as a list of TagsMetricsPair. */ Map<String, Map<String, List<TagsMetricsPair>>> makeMap( Collection<MetricsContext> contexts) throws IOException { Map<String, Map<String, List<TagsMetricsPair>>> map = new TreeMap<String, Map<String, List<TagsMetricsPair>>>(); for (MetricsContext context : contexts) { Map<String, List<TagsMetricsPair>> records = new TreeMap<String, List<TagsMetricsPair>>(); map.put(context.getContextName(), records); for (Map.Entry<String, Collection<OutputRecord>> r : context.getAllRecords().entrySet()) { List<TagsMetricsPair> metricsAndTags = new ArrayList<TagsMetricsPair>(); records.put(r.getKey(), metricsAndTags); for (OutputRecord outputRecord : r.getValue()) { TagMap tagMap = outputRecord.getTagsCopy(); MetricMap metricMap = outputRecord.getMetricsCopy(); metricsAndTags.add(new TagsMetricsPair(tagMap, metricMap)); } } } return map; }
/** * Collects all metric data, and returns a map: * contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ]. * The values are either String or Number. The final value is implemented * as a list of TagsMetricsPair. */ Map<String, Map<String, List<TagsMetricsPair>>> makeMap( Collection<MetricsContext> contexts) throws IOException { Map<String, Map<String, List<TagsMetricsPair>>> map = new TreeMap<String, Map<String, List<TagsMetricsPair>>>(); for (MetricsContext context : contexts) { Map<String, List<TagsMetricsPair>> records = new TreeMap<String, List<TagsMetricsPair>>(); map.put(context.getContextName(), records); for (Map.Entry<String, Collection<OutputRecord>> r : context.getAllRecords().entrySet()) { List<TagsMetricsPair> metricsAndTags = new ArrayList<TagsMetricsPair>(); records.put(r.getKey(), metricsAndTags); for (OutputRecord outputRecord : r.getValue()) { TagMap tagMap = outputRecord.getTagsCopy(); MetricMap metricMap = outputRecord.getMetricsCopy(); metricsAndTags.add(new TagsMetricsPair(tagMap, metricMap)); } } } return map; }
/** * Collects all metric data, and returns a map: * contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ]. * The values are either String or Number. The final value is implemented * as a list of TagsMetricsPair. */ Map<String, Map<String, List<TagsMetricsPair>>> makeMap( Collection<MetricsContext> contexts) throws IOException { Map<String, Map<String, List<TagsMetricsPair>>> map = new TreeMap<String, Map<String, List<TagsMetricsPair>>>(); for (MetricsContext context : contexts) { Map<String, List<TagsMetricsPair>> records = new TreeMap<String, List<TagsMetricsPair>>(); map.put(context.getContextName(), records); for (Map.Entry<String, Collection<OutputRecord>> r : context.getAllRecords().entrySet()) { List<TagsMetricsPair> metricsAndTags = new ArrayList<TagsMetricsPair>(); records.put(r.getKey(), metricsAndTags); for (OutputRecord outputRecord : r.getValue()) { TagMap tagMap = outputRecord.getTagsCopy(); MetricMap metricMap = outputRecord.getMetricsCopy(); metricsAndTags.add(new TagsMetricsPair(tagMap, metricMap)); } } } return map; }
/** * Collects all metric data, and returns a map: * contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ]. * The values are either String or Number. The final value is implemented * as a list of TagsMetricsPair. */ Map<String, Map<String, List<TagsMetricsPair>>> makeMap( Collection<MetricsContext> contexts) throws IOException { Map<String, Map<String, List<TagsMetricsPair>>> map = new TreeMap<String, Map<String, List<TagsMetricsPair>>>(); for (MetricsContext context : contexts) { Map<String, List<TagsMetricsPair>> records = new TreeMap<String, List<TagsMetricsPair>>(); map.put(context.getContextName(), records); for (Map.Entry<String, Collection<OutputRecord>> r : context.getAllRecords().entrySet()) { List<TagsMetricsPair> metricsAndTags = new ArrayList<TagsMetricsPair>(); records.put(r.getKey(), metricsAndTags); for (OutputRecord outputRecord : r.getValue()) { TagMap tagMap = outputRecord.getTagsCopy(); MetricMap metricMap = outputRecord.getMetricsCopy(); metricsAndTags.add(new TagsMetricsPair(tagMap, metricMap)); } } } return map; }
@InterfaceAudience.Private @Override protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).emitRecord( contextName, recordName, outRec); if (contextName == null || recordName == null || outRec == null) { throw new IOException(contextName + ":" + recordName + ":" + outRec); } } catch (IOException e) { LOG.warn("emitRecord failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override public void startMonitoring() throws IOException { for (MetricsContext ctxt : subctxt) { try { ctxt.startMonitoring(); } catch (IOException e) { LOG.warn("startMonitoring failed: " + ctxt.getContextName(), e); } } }
@InterfaceAudience.Private @Override protected void flush() throws IOException { for (MetricsContext ctxt : subctxt) { try { ((AbstractMetricsContext)ctxt).flush(); } catch (IOException e) { LOG.warn("flush failed: " + ctxt.getContextName(), e); } } }