Interface TelemetryEntry


public interface TelemetryEntry
Interface for individual telemetry entries. Intended for use by backends; most users should use the TelemetryTable class.

Implementations must not throw from logging, metadata, or discard-checking methods. Recoverable failures should be reported through TelemetryRegistry.reportWarning(String, String) and skipped.

Methods on the same entry may be called concurrently. Implementations must copy mutable input they retain after a method returns.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Checks if this entry discards data.
    void
    Indicates duplicate values should be preserved.
    void
    logBoolean(boolean value, long timestamp)
    Logs a boolean.
    void
    logBooleanArray(boolean[] value, long timestamp)
    Logs a boolean array.
    default void
    logByte(byte value, long timestamp)
    Logs a byte.
    void
    logDouble(double value, long timestamp)
    Logs a double.
    void
    logDoubleArray(double[] value, long timestamp)
    Logs a double array.
    void
    logFloat(float value, long timestamp)
    Logs a float.
    void
    logFloatArray(float[] value, long timestamp)
    Logs a float array.
    default void
    logInt(int value, long timestamp)
    Logs an int.
    void
    logIntArray(int[] value, long timestamp)
    Logs an int array.
    void
    logLong(long value, long timestamp)
    Logs a long.
    void
    logLongArray(long[] value, long timestamp)
    Logs a long array.
    <T> void
    logProtobuf(T value, Protobuf<? super T, ?> proto, long timestamp)
    Logs an object with protobuf serialization.
    void
    logRaw(byte[] value, String typeString, long timestamp)
    Logs a byte array (raw value).
    default void
    logShort(short value, long timestamp)
    Logs a short.
    void
    logShortArray(short[] value, long timestamp)
    Logs a short array.
    void
    logString(String value, String typeString, long timestamp)
    Logs a String.
    void
    logStringArray(String[] value, long timestamp)
    Logs a String array.
    <T> void
    logStruct(T value, Struct<? super T> struct, long timestamp)
    Logs an object with struct serialization.
    <T> void
    logStructArray(T[] value, Struct<? super T> struct, long timestamp)
    Logs an array of objects with struct serialization.
    void
    setProperty(String key, String value)
    Sets property for a value.
  • Method Details

    • isDiscard

      default boolean isDiscard()
      Checks if this entry discards data.
      Returns:
      true if this entry discards logged data
    • keepDuplicates

      void keepDuplicates()
      Indicates duplicate values should be preserved. Normally duplicate values are ignored.
    • setProperty

      void setProperty(String key, String value)
      Sets property for a value. Properties are stored as a key/value map.
      Parameters:
      key - property key
      value - property value; must be a valid JSON value string (e.g. quoted string, number, true, false, null, object, or array)
    • logStruct

      <T> void logStruct(T value, Struct<? super T> struct, long timestamp)
      Logs an object with struct serialization.
      Type Parameters:
      T - data type
      Parameters:
      value - the value
      struct - struct serializer for the value type or one of its supertypes
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logProtobuf

      <T> void logProtobuf(T value, Protobuf<? super T, ?> proto, long timestamp)
      Logs an object with protobuf serialization.
      Type Parameters:
      T - data type
      Parameters:
      value - the value
      proto - protobuf serializer for the value type or one of its supertypes
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logStructArray

      <T> void logStructArray(T[] value, Struct<? super T> struct, long timestamp)
      Logs an array of objects with struct serialization.
      Type Parameters:
      T - data type
      Parameters:
      value - the value
      struct - struct serializer for the value type or one of its supertypes
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logBoolean

      void logBoolean(boolean value, long timestamp)
      Logs a boolean.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logByte

      default void logByte(byte value, long timestamp)
      Logs a byte.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logShort

      default void logShort(short value, long timestamp)
      Logs a short.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logInt

      default void logInt(int value, long timestamp)
      Logs an int.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logLong

      void logLong(long value, long timestamp)
      Logs a long.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logFloat

      void logFloat(float value, long timestamp)
      Logs a float.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logDouble

      void logDouble(double value, long timestamp)
      Logs a double.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logString

      void logString(String value, String typeString, long timestamp)
      Logs a String.
      Parameters:
      value - the value
      typeString - the type string
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logBooleanArray

      void logBooleanArray(boolean[] value, long timestamp)
      Logs a boolean array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logShortArray

      void logShortArray(short[] value, long timestamp)
      Logs a short array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logIntArray

      void logIntArray(int[] value, long timestamp)
      Logs an int array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logLongArray

      void logLongArray(long[] value, long timestamp)
      Logs a long array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logFloatArray

      void logFloatArray(float[] value, long timestamp)
      Logs a float array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logDoubleArray

      void logDoubleArray(double[] value, long timestamp)
      Logs a double array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logStringArray

      void logStringArray(String[] value, long timestamp)
      Logs a String array.
      Parameters:
      value - the value
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time
    • logRaw

      void logRaw(byte[] value, String typeString, long timestamp)
      Logs a byte array (raw value).
      Parameters:
      value - the value
      typeString - the type string
      timestamp - timestamp in nanoseconds in the same time base as WPIUtilJNI.now(), or 0 to use the current time