Interface TelemetryBackend

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
DataLogTelemetryBackend, DiscardTelemetryBackend, HootTelemetryBackend, MockTelemetryBackend, MultiTelemetryBackend, NetworkTablesTelemetryBackend

public interface TelemetryBackend extends AutoCloseable
Interface for telemetry backends.

Implementations registered with TelemetryRegistry must be thread-safe. Backend and entry methods may be called concurrently, and entry removal or backend closure may overlap a call already in progress on a previously returned entry.

  • Method Details

    • getEntry

      TelemetryEntry getEntry(String path)
      Create an entry for the given path.

      Backend implementations must not throw from this method. Recoverable failures should be reported through TelemetryRegistry.reportWarning(String, String) and represented with a discard entry.

      Parameters:
      path - full name
      Returns:
      telemetry entry
    • ownsBackend

      default boolean ownsBackend(TelemetryBackend backend)
      Returns whether this backend is or owns the given backend instance for lifecycle purposes.

      Composite backends should override this and recursively check child backends that are closed when this backend is closed. The registry uses this to avoid closing a displaced backend that is now retained by another registered backend.

      Parameters:
      backend - backend instance
      Returns:
      True if this backend is or owns the given backend
    • sharesBackendWith

      default boolean sharesBackendWith(TelemetryBackend backend)
      Returns whether this backend shares lifecycle ownership with another backend.

      The registry uses this to avoid closing displaced backends whose close operation would close a backend that remains registered elsewhere.

      Parameters:
      backend - backend instance
      Returns:
      True if this backend owns, is owned by, or shares a child backend with the given backend
    • removeEntry

      default void removeEntry(String path)
      Removes an entry for the given path.

      Backend implementations must not throw from this method.

      Parameters:
      path - normalized full name