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 TypeMethodDescriptiondefault booleanChecks if this entry discards data.voidIndicates duplicate values should be preserved.voidlogBoolean(boolean value, long timestamp) Logs a boolean.voidlogBooleanArray(boolean[] value, long timestamp) Logs a boolean array.default voidlogByte(byte value, long timestamp) Logs a byte.voidlogDouble(double value, long timestamp) Logs a double.voidlogDoubleArray(double[] value, long timestamp) Logs a double array.voidlogFloat(float value, long timestamp) Logs a float.voidlogFloatArray(float[] value, long timestamp) Logs a float array.default voidlogInt(int value, long timestamp) Logs an int.voidlogIntArray(int[] value, long timestamp) Logs an int array.voidlogLong(long value, long timestamp) Logs a long.voidlogLongArray(long[] value, long timestamp) Logs a long array.<T> voidlogProtobuf(T value, Protobuf<? super T, ?> proto, long timestamp) Logs an object with protobuf serialization.voidLogs a byte array (raw value).default voidlogShort(short value, long timestamp) Logs a short.voidlogShortArray(short[] value, long timestamp) Logs a short array.voidLogs a String.voidlogStringArray(String[] value, long timestamp) Logs a String array.<T> voidLogs an object with struct serialization.<T> voidlogStructArray(T[] value, Struct<? super T> struct, long timestamp) Logs an array of objects with struct serialization.voidsetProperty(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
-
logStruct
Logs an object with struct serialization.- Type Parameters:
T- data type- Parameters:
value- the valuestruct- struct serializer for the value type or one of its supertypestimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logProtobuf
Logs an object with protobuf serialization.- Type Parameters:
T- data type- Parameters:
value- the valueproto- protobuf serializer for the value type or one of its supertypestimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logStructArray
Logs an array of objects with struct serialization.- Type Parameters:
T- data type- Parameters:
value- the valuestruct- struct serializer for the value type or one of its supertypestimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logBoolean
void logBoolean(boolean value, long timestamp) Logs a boolean.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logByte
default void logByte(byte value, long timestamp) Logs a byte.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logShort
default void logShort(short value, long timestamp) Logs a short.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logInt
default void logInt(int value, long timestamp) Logs an int.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logLong
void logLong(long value, long timestamp) Logs a long.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logFloat
void logFloat(float value, long timestamp) Logs a float.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logDouble
void logDouble(double value, long timestamp) Logs a double.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logString
Logs a String.- Parameters:
value- the valuetypeString- the type stringtimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logBooleanArray
void logBooleanArray(boolean[] value, long timestamp) Logs a boolean array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logShortArray
void logShortArray(short[] value, long timestamp) Logs a short array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logIntArray
void logIntArray(int[] value, long timestamp) Logs an int array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logLongArray
void logLongArray(long[] value, long timestamp) Logs a long array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logFloatArray
void logFloatArray(float[] value, long timestamp) Logs a float array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logDoubleArray
void logDoubleArray(double[] value, long timestamp) Logs a double array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logStringArray
Logs a String array.- Parameters:
value- the valuetimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-
logRaw
Logs a byte array (raw value).- Parameters:
value- the valuetypeString- the type stringtimestamp- timestamp in nanoseconds in the same time base asWPIUtilJNI.now(), or 0 to use the current time
-