common/src/main/java/bio/terra/cloudres/util/MetricsHelper.java
/**
   * Records the latency for Cloud API calls.
   *
   * <p>This will be in path /cloud/error with client and methodName as tags,
   *
   * @param client, the client which use this library.
   * @param method The Cloud API calls.
   * @param httpStatusCode the httpStatusCode from cloud. If things goes wrong within CRL, use the
   *     default generic error code(1) instead.
   */
Records the latency for Cloud API calls.
This will be in path /cloud/error with client and methodName as tags.

@param client, the client which use this library.
@param method The Cloud API calls.
Records the latency for Cloud API calls . This will be in path / cloud / error with client and methodName as tags . @param client the client which use this library . @param method The Cloud API calls .
public static void recordError(String client, CloudOperation method, OptionalInt httpStatusCode) {
    int errorCode = httpStatusCode.orElse(GENERIC_UNKNOWN_ERROR_CODE);
    TagContext tctx =
        tagger
            .emptyBuilder()
            .put(KEY_ERROR, TagValue.create(String.valueOf(errorCode)), tagMetadata)
            .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(ERROR_COUNT, 1).record(tctx);
    }
  }
public static void recordError ( String client , CloudOperation method , OptionalInt httpStatusCode ) { int errorCode = httpStatusCode . orElse ( GENERIC_UNKNOWN_ERROR_CODE ) ; TagContext tctx = tagger . emptyBuilder ( ) . put ( KEY_ERROR , TagValue . create ( String . valueOf ( errorCode ) ) , tagMetadata ) . 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 ( ERROR_COUNT , 1 ) . record ( tctx ) ; } }
Records the latency for Cloud API calls.
Records the latency for Cloud API calls .