Java Code Examples for org.apache.hadoop.metrics2.MetricsInfo#description()

The following examples show how to use org.apache.hadoop.metrics2.MetricsInfo#description() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetricsSystemImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override public synchronized <T>
T register(String name, String desc, T source) {
  MetricsSourceBuilder sb = MetricsAnnotations.newSourceBuilder(source);
  final MetricsSource s = sb.build();
  MetricsInfo si = sb.info();
  String name2 = name == null ? si.name() : name;
  final String finalDesc = desc == null ? si.description() : desc;
  final String finalName = // be friendly to non-metrics tests
      DefaultMetricsSystem.sourceName(name2, !monitoring);
  allSources.put(finalName, s);
  LOG.debug(finalName +", "+ finalDesc);
  if (monitoring) {
    registerSource(finalName, finalDesc, s);
  }
  // We want to re-register the source to pick up new config when the
  // metrics system restarts.
  register(finalName, new AbstractCallback() {
    @Override public void postStart() {
      registerSource(finalName, finalDesc, s);
    }
  });
  return source;
}
 
Example 2
Source File: MetricsSystemImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override public synchronized <T>
T register(String name, String desc, T source) {
  MetricsSourceBuilder sb = MetricsAnnotations.newSourceBuilder(source);
  final MetricsSource s = sb.build();
  MetricsInfo si = sb.info();
  String name2 = name == null ? si.name() : name;
  final String finalDesc = desc == null ? si.description() : desc;
  final String finalName = // be friendly to non-metrics tests
      DefaultMetricsSystem.sourceName(name2, !monitoring);
  allSources.put(finalName, s);
  LOG.debug(finalName +", "+ finalDesc);
  if (monitoring) {
    registerSource(finalName, finalDesc, s);
  }
  // We want to re-register the source to pick up new config when the
  // metrics system restarts.
  register(finalName, new AbstractCallback() {
    @Override public void postStart() {
      registerSource(finalName, finalDesc, s);
    }
  });
  return source;
}
 
Example 3
Source File: MutableHistogram.java    From hbase with Apache License 2.0 4 votes vote down vote up
public MutableHistogram(MetricsInfo info) {
  this(info.name(), info.description());
}
 
Example 4
Source File: MutableRangeHistogram.java    From hbase with Apache License 2.0 4 votes vote down vote up
public MutableRangeHistogram(MetricsInfo info) {
  this(info.name(), info.description());
}
 
Example 5
Source File: MutableTimeHistogram.java    From hbase with Apache License 2.0 4 votes vote down vote up
public MutableTimeHistogram(MetricsInfo info) {
  this(info.name(), info.description());
}
 
Example 6
Source File: MutableSizeHistogram.java    From hbase with Apache License 2.0 4 votes vote down vote up
public MutableSizeHistogram(MetricsInfo info) {
  this(info.name(), info.description());
}