common/src/main/java/bio/terra/cloudres/util/MetricsHelper.java
/**
   * Record the latency for Cloud API calls.
   *
   * @param client, the client which use this library.
   * @param method the cloud api
   * @param latency The API latency.
   */
Record the latency for Cloud API calls.
@param client, the client which use this library.
@param method the cloud api
@param latency The API latency.
Record the latency for Cloud API calls . @param client the client which use this library . @param method the cloud api @param latency The API latency .
public static void recordLatency(String client, CloudOperation method, Duration latency) {
    TagContext tctx =
        tagger
            .emptyBuilder()
            .put(KEY_CLOUD_API, TagValue.create(method.toString()), tagMetadata)
            .put(KEY_CLIENT, TagValue.create(client), tagMetadata)
            .build();
    try (Scope ss = tagger.withTagContext(tctx)) {
      statsRecorder.newMeasureMap().put(LATENCY, latency.toMillis()).record(tctx);
    }
  }
public static void recordLatency ( String client , CloudOperation method , Duration latency ) { TagContext tctx = tagger . emptyBuilder ( ) . put ( KEY_CLOUD_API , TagValue . create ( method . toString ( ) ) , tagMetadata ) . put ( KEY_CLIENT , TagValue . create ( client ) , tagMetadata ) . build ( ) ; try ( Scope ss = tagger . withTagContext ( tctx ) ) { statsRecorder . newMeasureMap ( ) . put ( LATENCY , latency . toMillis ( ) ) . record ( tctx ) ; } }
Record the latency for Cloud API calls.
Record the latency for Cloud API calls .