org.apache.hadoop.metrics2.lib.MutableRate Java Examples

The following examples show how to use org.apache.hadoop.metrics2.lib.MutableRate. 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: XceiverClientMetrics.java    From hadoop-ozone with Apache License 2.0 6 votes vote down vote up
public void init() {
  int numEnumEntries = ContainerProtos.Type.values().length;
  this.registry = new MetricsRegistry(SOURCE_NAME);

  this.pendingOpsArray = new MutableCounterLong[numEnumEntries];
  this.opsArray = new MutableCounterLong[numEnumEntries];
  this.containerOpsLatency = new MutableRate[numEnumEntries];
  for (int i = 0; i < numEnumEntries; i++) {
    pendingOpsArray[i] = registry.newCounter(
        "numPending" + ContainerProtos.Type.forNumber(i + 1),
        "number of pending" + ContainerProtos.Type.forNumber(i + 1) + " ops",
        (long) 0);
    opsArray[i] = registry
        .newCounter("opCount" + ContainerProtos.Type.forNumber(i + 1),
            "number of" + ContainerProtos.Type.forNumber(i + 1) + " ops",
            (long) 0);

    containerOpsLatency[i] = registry.newRate(
        ContainerProtos.Type.forNumber(i + 1) + "Latency",
        "latency of " + ContainerProtos.Type.forNumber(i + 1)
        + " ops");
  }
}
 
Example #2
Source File: ContainerMetrics.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public ContainerMetrics(int[] intervals) {
  int numEnumEntries = ContainerProtos.Type.values().length;
  final int len = intervals.length;
  this.numOpsArray = new MutableCounterLong[numEnumEntries];
  this.opsBytesArray = new MutableCounterLong[numEnumEntries];
  this.opsLatency = new MutableRate[numEnumEntries];
  this.opsLatQuantiles = new MutableQuantiles[numEnumEntries][len];
  this.registry = new MetricsRegistry("StorageContainerMetrics");
  for (int i = 0; i < numEnumEntries; i++) {
    numOpsArray[i] = registry.newCounter(
        "num" + ContainerProtos.Type.forNumber(i + 1),
        "number of " + ContainerProtos.Type.forNumber(i + 1) + " ops",
        (long) 0);
    opsBytesArray[i] = registry.newCounter(
        "bytes" + ContainerProtos.Type.forNumber(i + 1),
        "bytes used by " + ContainerProtos.Type.forNumber(i + 1) + "op",
        (long) 0);
    opsLatency[i] = registry.newRate(
        "latency" + ContainerProtos.Type.forNumber(i + 1),
        ContainerProtos.Type.forNumber(i + 1) + " op");

    for (int j = 0; j < len; j++) {
      int interval = intervals[j];
      String quantileName = ContainerProtos.Type.forNumber(i + 1) + "Nanos"
          + interval + "s";
      opsLatQuantiles[i][j] = registry.newQuantiles(quantileName,
          "latency of Container ops", "ops", "latency", interval);
    }
  }
}
 
Example #3
Source File: CSMMetrics.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public CSMMetrics() {
  int numCmdTypes = ContainerProtos.Type.values().length;
  this.opsLatency = new MutableRate[numCmdTypes];
  this.registry = new MetricsRegistry(CSMMetrics.class.getSimpleName());
  for (int i = 0; i < numCmdTypes; i++) {
    opsLatency[i] = registry.newRate(
        ContainerProtos.Type.forNumber(i + 1).toString(),
        ContainerProtos.Type.forNumber(i + 1) + " op");
  }
}
 
Example #4
Source File: CSMMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableRate getApplyTransactionLatency() {
  return applyTransaction;
}
 
Example #5
Source File: EventWatcherMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public MutableRate getCompletionTime() {
  return completionTime;
}
 
Example #6
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableRate getSnapshotRequestLatency() {
  return snapshotRequestLatency;
}
 
Example #7
Source File: OzoneManagerDoubleBufferMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public MutableRate getFlushTime() {
  return flushTime;
}