/** * Subclasses should override this if they subclass MetricsRecordImpl. * @param recordName the name of the record * @return newly created instance of MetricsRecordImpl or subclass */ protected MetricsRecord newRecord(String recordName) { return new MetricsRecordImpl(recordName, this); }
/** * Sets the named metric to the specified value. * * @param metricName name of the metric * @param metricValue new value of the metric * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void setMetric(String metricName, long metricValue) { setAbsolute(metricName, Long.valueOf(metricValue)); }
/** * Increments the named metric by the specified value. * * @param metricName name of the metric * @param metricValue incremental value * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void incrMetric(String metricName, long metricValue) { setIncrement(metricName, Long.valueOf(metricValue)); }
String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); Map<String,MetricValue> metricUpdates = record.getMetricTable();
/** * Called by MetricsRecordImpl.remove(). Removes all matching rows in * the internal table of metric data. A row matches if it has the same * tag names and values as record, but it may also have additional * tags. */ protected void remove(MetricsRecordImpl record) { String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); RecordMap recordMap = getRecordMap(recordName); synchronized (recordMap) { Iterator<TagMap> it = recordMap.keySet().iterator(); while (it.hasNext()) { TagMap rowTags = it.next(); if (rowTags.containsAll(tagTable)) { it.remove(); } } } }
@Override protected void remove(MetricsRecordImpl record) { super.remove(record); String recordName = record.getRecordName(); JMXContextMBean bean = JMXBeans.remove(recordName); if (bean == null) { return; } // Currently - one bean per record, so remove the bean ObjectName name = beanHandles.remove(bean); MBeanUtil.unregisterMBean(name); }
String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); Map<String,MetricValue> metricUpdates = record.getMetricTable();
/** * Called by MetricsRecordImpl.remove(). Removes all matching rows in * the internal table of metric data. A row matches if it has the same * tag names and values as record, but it may also have additional * tags. */ protected void remove(MetricsRecordImpl record) { String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); RecordMap recordMap = getRecordMap(recordName); synchronized (recordMap) { Iterator<TagMap> it = recordMap.keySet().iterator(); while (it.hasNext()) { TagMap rowTags = it.next(); if (rowTags.containsAll(tagTable)) { it.remove(); } } } }
String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); Map<String,MetricValue> metricUpdates = record.getMetricTable();
/** * Called by MetricsRecordImpl.remove(). Removes all matching rows in * the internal table of metric data. A row matches if it has the same * tag names and values as record, but it may also have additional * tags. */ protected void remove(MetricsRecordImpl record) { String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); RecordMap recordMap = getRecordMap(recordName); synchronized (recordMap) { Iterator<TagMap> it = recordMap.keySet().iterator(); while (it.hasNext()) { TagMap rowTags = it.next(); if (rowTags.containsAll(tagTable)) { it.remove(); } } } }
/** * Increments the named metric by the specified value. * * @param metricName name of the metric * @param metricValue incremental value * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void incrMetric(String metricName, byte metricValue) { setIncrement(metricName, Byte.valueOf(metricValue)); }
/** * Sets the named metric to the specified value. * * @param metricName name of the metric * @param metricValue new value of the metric * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void setMetric(String metricName, int metricValue) { setAbsolute(metricName, Integer.valueOf(metricValue)); }
/** * Subclasses should override this if they subclass MetricsRecordImpl. * @param recordName the name of the record * @return newly created instance of MetricsRecordImpl or subclass */ protected MetricsRecord newRecord(String recordName) { return new MetricsRecordImpl(recordName, this); }
String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); Map<String,MetricValue> metricUpdates = record.getMetricTable();
/** * Called by MetricsRecordImpl.remove(). Removes all matching rows in * the internal table of metric data. A row matches if it has the same * tag names and values as record, but it may also have additional * tags. */ protected void remove(MetricsRecordImpl record) { String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); RecordMap recordMap = getRecordMap(recordName); synchronized (recordMap) { Iterator<TagMap> it = recordMap.keySet().iterator(); while (it.hasNext()) { TagMap rowTags = it.next(); if (rowTags.containsAll(tagTable)) { it.remove(); } } } }
/** * Increments the named metric by the specified value. * * @param metricName name of the metric * @param metricValue incremental value * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void incrMetric(String metricName, short metricValue) { setIncrement(metricName, Short.valueOf(metricValue)); }
/** * Sets the named metric to the specified value. * * @param metricName name of the metric * @param metricValue new value of the metric * @throws MetricsException if the metricName or the type of the metricValue * conflicts with the configuration */ public void setMetric(String metricName, byte metricValue) { setAbsolute(metricName, Byte.valueOf(metricValue)); }
/** * Subclasses should override this if they subclass MetricsRecordImpl. * @param recordName the name of the record * @return newly created instance of MetricsRecordImpl or subclass */ protected MetricsRecord newRecord(String recordName) { return new MetricsRecordImpl(recordName, this); }
String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); Map<String,MetricValue> metricUpdates = record.getMetricTable();
/** * Called by MetricsRecordImpl.remove(). Removes all matching rows in * the internal table of metric data. A row matches if it has the same * tag names and values as record, but it may also have additional * tags. */ protected void remove(MetricsRecordImpl record) { String recordName = record.getRecordName(); TagMap tagTable = record.getTagTable(); RecordMap recordMap = getRecordMap(recordName); synchronized (recordMap) { Iterator<TagMap> it = recordMap.keySet().iterator(); while (it.hasNext()) { TagMap rowTags = it.next(); if (rowTags.containsAll(tagTable)) { it.remove(); } } } }