Interface Telemetry.Scope

All Superinterfaces:
AutoCloseable
Enclosing interface:
Telemetry

public static interface Telemetry.Scope extends AutoCloseable
An operation in progress.

Closing without reporting an outcome is treated as a failure, since an operation that neither succeeded nor failed is almost always one that threw.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Telemetry.Scope
    A scope that records nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    failed(Throwable failure)
    Records that the operation threw.
    void
    outcome(String outcome)
    Records how the operation ended.
  • Field Details

  • Method Details

    • outcome

      void outcome(String outcome)
      Records how the operation ended.
      Parameters:
      outcome - one of the outcome values in MetricNames
    • failed

      void failed(Throwable failure)
      Records that the operation threw.
      Parameters:
      failure - what went wrong
    • close

      void close()
      Specified by:
      close in interface AutoCloseable