Class MetricsUtils

java.lang.Object
com.google.auth.oauth2.MetricsUtils

class MetricsUtils extends Object
  • Field Details

  • Constructor Details

    • MetricsUtils

      MetricsUtils()
  • Method Details

    • getLanguageAndAuthLibraryVersions

      static String getLanguageAndAuthLibraryVersions()
      Gets the x-goog-api-client header value for the current Java language version and the auth library version.
      Returns:
      the header value.
    • getAuthLibraryVersion

      private static String getAuthLibraryVersion()
    • getGoogleCredentialsMetricsHeader

      static String getGoogleCredentialsMetricsHeader(MetricsUtils.RequestType requestType, CredentialTypeForMetrics credentialTypeForMetrics)
      Formulates metrics header string. Header string takes format: “gl-java/JAVA_VERSION auth/LIB_VERSION auth-request-type/REQUEST_TYPE cred-type/CREDENTIAL_TYPE”. "auth-request-type" and "cred-type" can be omitted.
      Parameters:
      requestType - Auth request type to be specified in metrics, omit when RequestType.UNTRACKED
      credentialTypeForMetrics - Credential type to be included in metrics string, omit when CredentialTypeForMetrics.DO_NOT_SEND
      Returns:
      metrics header string to send
    • setMetricsHeader

      static void setMetricsHeader(com.google.api.client.http.HttpRequest request, String metricsHeader)