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

The following examples show how to use org.apache.hadoop.metrics2.lib.MutableCounterLong. 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: SCMPipelineMetrics.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
void createPerPipelineMetrics(Pipeline pipeline) {
  numBlocksAllocated.put(pipeline.getId(), new MutableCounterLong(Interns
      .info(getBlockAllocationMetricName(pipeline),
          "Number of blocks allocated in pipeline " + pipeline.getId()), 0L));
  numBytesWritten.put(pipeline.getId(), new MutableCounterLong(Interns
      .info(getBytesWrittenMetricName(pipeline),
          "Number of bytes written into pipeline " + pipeline.getId()), 0L));
}
 
Example #3
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 #4
Source File: SCMPipelineMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
/**
 * Increments the number of total bytes that write into the pipeline.
 */
void incNumPipelineBytesWritten(Pipeline pipeline, long bytes) {
  numBytesWritten.put(pipeline.getId(), new MutableCounterLong(
      Interns.info(getBytesWrittenMetricName(pipeline), "Number of" +
          " bytes written into pipeline " + pipeline.getId()), bytes));
}
 
Example #5
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumNonZeroDeltaRequests() {
  return numNonZeroDeltaRequests;
}
 
Example #6
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumUpdatesInDeltaTotal() {
  return numUpdatesInDeltaTotal;
}
 
Example #7
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumDeltaRequestsFailed() {
  return numDeltaRequestsFailed;
}
 
Example #8
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumSnapshotRequestsFailed() {
  return numSnapshotRequestsFailed;
}
 
Example #9
Source File: OzoneManagerSyncMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumSnapshotRequests() {
  return numSnapshotRequests;
}
 
Example #10
Source File: EventWatcherMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public MutableCounterLong getCompletedEvents() {
  return completedEvents;
}
 
Example #11
Source File: EventWatcherMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public MutableCounterLong getTimedOutEvents() {
  return timedOutEvents;
}
 
Example #12
Source File: EventWatcherMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@VisibleForTesting
public MutableCounterLong getTrackedEvents() {
  return trackedEvents;
}
 
Example #13
Source File: SCMPipelineMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
/**
 * Increments number of blocks allocated for the pipeline.
 */
void incNumBlocksAllocated(PipelineID pipelineID) {
  Optional.ofNullable(numBlocksAllocated.get(pipelineID)).ifPresent(
      MutableCounterLong::incr);
}
 
Example #14
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getCurrentContainersWithOneReplicaReportedCount() {
  return currentContainersWithOneReplicaReportedCount;
}
 
Example #15
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumContainerWithOneReplicaReportedThreshold() {
  return numContainerWithOneReplicaReportedThreshold;
}
 
Example #16
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getCurrentPipelinesWithAtleastOneReplicaCount() {
  return currentPipelinesWithAtleastOneReplicaReportedCount;
}
 
Example #17
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong
    getNumPipelinesWithAtleastOneReplicaReportedThreshold() {
  return numPipelinesWithAtleastOneReplicaReportedThreshold;
}
 
Example #18
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getCurrentHealthyPipelinesCount() {
  return currentHealthyPipelinesCount;
}
 
Example #19
Source File: SafeModeMetrics.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public MutableCounterLong getNumHealthyPipelinesThreshold() {
  return numHealthyPipelinesThreshold;
}