Package io.deephaven.process.telemetry
Class TelemetryLogger
java.lang.Object
io.deephaven.process.telemetry.TelemetryLogger
A TelemetryLogger is created by each long-lived "instance" of an object for which telemetry will be tracked. The
TelemetryLogger will create any number of requested
TelemetryItem
instances to be tracked, each with its own
unique identifier-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Helper-class which may be used for "set-once" elements of theTelemetryLogger
class -
Constructor Summary
ConstructorsConstructorDescriptionTelemetryLogger
(com.fishlib.io.logger.Logger defaultLogger) Construct a new TelemetryLogger instance.TelemetryLogger
(com.fishlib.io.logger.Logger defaultLogger, boolean enabled) Construct a new TelemetryLogger instanceTelemetryLogger
(com.fishlib.io.logger.Logger defaultLogger, boolean enabled, TelemetryLogger.TelemetryInfo telemetryInfo) Construct a new TelemetryLogger instanceTelemetryLogger
(com.fishlib.io.logger.Logger defaultLogger, TelemetryLogger.TelemetryInfo telemetryInfo) Construct a new TelemetryLogger instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
enabledFor
(String whom) Pass-through toTelemetryService.enabledFor(String)
getInfo()
Copies potential "set-once" elements for this TelemetryLogger instance to a new TelemetryInfo objectlong
void
setPqSerial
(long pqSerial) Update the "set-once" pq-serial-numbervoid
setProcessInfoId
(String processInfoId) Update the "set-once" worker ProcessInfoIdvoid
setTableName
(String tableName) Update the "set-once" table-namevoid
Update the "set-once" worker-namevoid
setWorkerHost
(String workerHost) Update the "set-once" worker host-nametelemetryItem
(com.fishlib.io.log.LogLevel level, String actionName, String eventStatus) Gets a newTelemetryItem
instance, and logs the initialization of the item as LogLevel.INFOtelemetryItem
(String actionName) Gets a newTelemetryItem
instance.telemetryItem
(String actionName, String eventStatus) Gets a newTelemetryItem
instance, and logs the initialization of the item as LogLevel.INFOvoid
updateFromInfo
(TelemetryLogger.TelemetryInfo telemetryInfo) Update "set-once" elements for this TelemetryLogger instancevoid
updateInfo
(String tableName, long pqSerial, QueryProcessorConnection qpc) void
updateInfo
(String tableName, long pqSerial, String workerName, String workerHost, String processInfoId)
-
Constructor Details
-
TelemetryLogger
public TelemetryLogger(com.fishlib.io.logger.Logger defaultLogger, boolean enabled) Construct a new TelemetryLogger instance- Parameters:
defaultLogger
- a valid Loggerenabled
- if the instance should log telemetry. SeeTelemetryService.enabledFor(String)
-
TelemetryLogger
public TelemetryLogger(com.fishlib.io.logger.Logger defaultLogger) Construct a new TelemetryLogger instance. TelemetryItems created by this instance will log to local log-file and possibly to a remote table- Parameters:
defaultLogger
- a valid Logger
-
TelemetryLogger
public TelemetryLogger(com.fishlib.io.logger.Logger defaultLogger, boolean enabled, TelemetryLogger.TelemetryInfo telemetryInfo) Construct a new TelemetryLogger instance- Parameters:
defaultLogger
- a valid Loggerenabled
- if the instance should log telemetry. SeeTelemetryService.enabledFor(String)
telemetryInfo
- used to update "set-once" elements as part of construction instead of viaupdateFromInfo(TelemetryInfo)
-
TelemetryLogger
public TelemetryLogger(com.fishlib.io.logger.Logger defaultLogger, TelemetryLogger.TelemetryInfo telemetryInfo) Construct a new TelemetryLogger instance. TelemetryItems created by this instance will log to local log-file and possibly to a remote table- Parameters:
defaultLogger
- a valid LoggertelemetryInfo
- used to update "set-once" elements as part of construction instead of viaupdateFromInfo(TelemetryInfo)
-
-
Method Details
-
enabledFor
Pass-through toTelemetryService.enabledFor(String)
- Parameters:
whom
- a string identifying a class, which may have a "Telemetry.enableFor.${whom}" property defined- Returns:
- the configuration value, if defined. Defaults to `true`
-
updateFromInfo
Update "set-once" elements for this TelemetryLogger instance- Parameters:
telemetryInfo
- structure containing elements which shall be set
-
updateInfo
public void updateInfo(@Nullable String tableName, long pqSerial, @Nullable QueryProcessorConnection qpc) -
updateInfo
-
getInfo
Copies potential "set-once" elements for this TelemetryLogger instance to a new TelemetryInfo object- Returns:
- a new TelemetryInfo instance which is set from the current TelemetryLogger's values
-
setPqSerial
public void setPqSerial(long pqSerial) Update the "set-once" pq-serial-number- Parameters:
pqSerial
- the serial of the PQ, if any
-
getPqSerial
public long getPqSerial() -
setWorker
Update the "set-once" worker-name- Parameters:
worker
- the worker-name
-
getWorker
-
setWorkerHost
Update the "set-once" worker host-name- Parameters:
workerHost
- the hostname where the worker is running
-
getWorkerHost
-
setProcessInfoId
Update the "set-once" worker ProcessInfoId- Parameters:
processInfoId
- the ProcessInfoId of the worker
-
getProcessInfoId
-
setTableName
Update the "set-once" table-name- Parameters:
tableName
- the name of the table
-
getTableName
-
telemetryItem
Gets a newTelemetryItem
instance. The initial status will not be logged- Parameters:
actionName
- the name of the new TelemetryItem- Returns:
- a new TelemetryItem instance which is appropriate for the current configuration
-
telemetryItem
Gets a newTelemetryItem
instance, and logs the initialization of the item as LogLevel.INFO- Parameters:
actionName
- the name of the new TelemetryItemeventStatus
- the current status of the new TelemetryItem- Returns:
- a new TelemetryItem instance which is appropriate for the current configuration
-
telemetryItem
public TelemetryItem telemetryItem(com.fishlib.io.log.LogLevel level, String actionName, String eventStatus) Gets a newTelemetryItem
instance, and logs the initialization of the item as LogLevel.INFO- Parameters:
level
- LogLevel to use for local logs, if anyactionName
- the name of the new TelemetryItemeventStatus
- the current status of the new TelemetryItem- Returns:
- a new TelemetryItem instance which is appropriate for the current configuration
-