MetricsRecordDelegator(String recordName, ArrayList<MetricsContext> ctxts) { this.recordName = recordName; this.subrecs = new ArrayList<MetricsRecord>(ctxts.size()); for (MetricsContext ctxt : ctxts) { subrecs.add(ctxt.createRecord(recordName)); } }
MetricsRecordDelegator(String recordName, ArrayList<MetricsContext> ctxts) { this.recordName = recordName; this.subrecs = new ArrayList<MetricsRecord>(ctxts.size()); for (MetricsContext ctxt : ctxts) { subrecs.add(ctxt.createRecord(recordName)); } }
MetricsRecordDelegator(String recordName, ArrayList<MetricsContext> ctxts) { this.recordName = recordName; this.subrecs = new ArrayList<MetricsRecord>(ctxts.size()); for (MetricsContext ctxt : ctxts) { subrecs.add(ctxt.createRecord(recordName)); } }
MetricsRecordDelegator(String recordName, ArrayList<MetricsContext> ctxts) { this.recordName = recordName; this.subrecs = new ArrayList<MetricsRecord>(ctxts.size()); for (MetricsContext ctxt : ctxts) { subrecs.add(ctxt.createRecord(recordName)); } }
MetricsRecordDelegator(String recordName, ArrayList<MetricsContext> ctxts) { this.recordName = recordName; this.subrecs = new ArrayList<MetricsRecord>(ctxts.size()); for (MetricsContext ctxt : ctxts) { subrecs.add(ctxt.createRecord(recordName)); } }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Utility method to create and return new metrics record instance within the * given context. This record is tagged with the host name. * * @param context the context * @param recordName name of the record * @return newly created metrics record */ public static MetricsRecord createRecord(MetricsContext context, String recordName) { MetricsRecord metricsRecord = context.createRecord(recordName); metricsRecord.setTag("hostName", getHostName()); return metricsRecord; }
/** * Initializes, for testing, two NoEmitMetricsContext's, and adds one value * to the first of them. */ public void setUp() throws IOException { nc1 = new NoEmitMetricsContext(); nc1.init("test1", ContextFactory.getFactory()); nc2 = new NoEmitMetricsContext(); nc2.init("test2", ContextFactory.getFactory()); contexts = new ArrayList<MetricsContext>(); contexts.add(nc1); contexts.add(nc2); MetricsRecord r = nc1.createRecord("testRecord"); r.setTag("testTag1", "testTagValue1"); r.setTag("testTag2", "testTagValue2"); r.setMetric("testMetric1", 1); r.setMetric("testMetric2", 33); r.update(); Map<String, Collection<OutputRecord>> m = nc1.getAllRecords(); assertEquals(1, m.size()); assertEquals(1, m.values().size()); Collection<OutputRecord> outputRecords = m.values().iterator().next(); assertEquals(1, outputRecords.size()); outputRecord = outputRecords.iterator().next(); }
/** * Initializes, for testing, two NoEmitMetricsContext's, and adds one value * to the first of them. */ @Override public void setUp() throws IOException { nc1 = new NoEmitMetricsContext(); nc1.init("test1", ContextFactory.getFactory()); nc2 = new NoEmitMetricsContext(); nc2.init("test2", ContextFactory.getFactory()); contexts = new ArrayList<MetricsContext>(); contexts.add(nc1); contexts.add(nc2); MetricsRecord r = nc1.createRecord("testRecord"); r.setTag("testTag1", "testTagValue1"); r.setTag("testTag2", "testTagValue2"); r.setMetric("testMetric1", 1); r.setMetric("testMetric2", 33); r.update(); Map<String, Collection<OutputRecord>> m = nc1.getAllRecords(); assertEquals(1, m.size()); assertEquals(1, m.values().size()); Collection<OutputRecord> outputRecords = m.values().iterator().next(); assertEquals(1, outputRecords.size()); outputRecord = outputRecords.iterator().next(); }
/** * Initializes, for testing, two NoEmitMetricsContext's, and adds one value * to the first of them. */ @Override public void setUp() throws IOException { nc1 = new NoEmitMetricsContext(); nc1.init("test1", ContextFactory.getFactory()); nc2 = new NoEmitMetricsContext(); nc2.init("test2", ContextFactory.getFactory()); contexts = new ArrayList<MetricsContext>(); contexts.add(nc1); contexts.add(nc2); MetricsRecord r = nc1.createRecord("testRecord"); r.setTag("testTag1", "testTagValue1"); r.setTag("testTag2", "testTagValue2"); r.setMetric("testMetric1", 1); r.setMetric("testMetric2", 33); r.update(); Map<String, Collection<OutputRecord>> m = nc1.getAllRecords(); assertEquals(1, m.size()); assertEquals(1, m.values().size()); Collection<OutputRecord> outputRecords = m.values().iterator().next(); assertEquals(1, outputRecords.size()); outputRecord = outputRecords.iterator().next(); }