Class Tracer.NoopTracer

java.lang.Object
cloud.opencode.base.observability.Tracer.NoopTracer
All Implemented Interfaces:
Tracer
Enclosing interface:
Tracer

public static final class Tracer.NoopTracer extends Object implements Tracer
No-op implementation of Tracer with zero overhead. 零开销的 Tracer 空操作实现。
Since:
JDK 25, opencode-base-observability V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • startSpan

      public Span startSpan(String operationName, String key)
      Description copied from interface: Tracer
      Starts a new trace span for the given operation. 为给定的操作启动一个新的追踪 span。
      Specified by:
      startSpan in interface Tracer
      Parameters:
      operationName - the name of the operation (e.g., "GET", "PUT") | 操作名称(例如 "GET"、"PUT")
      key - the key or resource being operated on | 被操作的键或资源
      Returns:
      a new Span representing this operation | 代表此操作的新 Span
    • close

      public void close()
      Description copied from interface: Tracer
      Closes this tracer and releases any underlying resources. 关闭此追踪器并释放所有底层资源。
      Specified by:
      close in interface Tracer
    • toString

      public String toString()
      Overrides:
      toString in class Object