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 classHelper-class which may be used for "set-once" elements of theTelemetryLoggerclass -
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 booleanenabledFor(String whom) Pass-through toTelemetryService.enabledFor(String)getInfo()Copies potential "set-once" elements for this TelemetryLogger instance to a new TelemetryInfo objectlongvoidsetPqSerial(long pqSerial) Update the "set-once" pq-serial-numbervoidsetProcessInfoId(String processInfoId) Update the "set-once" worker ProcessInfoIdvoidsetTableName(String tableName) Update the "set-once" table-namevoidUpdate the "set-once" worker-namevoidsetWorkerHost(String workerHost) Update the "set-once" worker host-nametelemetryItem(com.fishlib.io.log.LogLevel level, String actionName, String eventStatus) Gets a newTelemetryIteminstance, and logs the initialization of the item as LogLevel.INFOtelemetryItem(String actionName) Gets a newTelemetryIteminstance.telemetryItem(String actionName, String eventStatus) Gets a newTelemetryIteminstance, and logs the initialization of the item as LogLevel.INFOvoidupdateFromInfo(TelemetryLogger.TelemetryInfo telemetryInfo) Update "set-once" elements for this TelemetryLogger instancevoidupdateInfo(String tableName, long pqSerial, QueryProcessorConnection qpc) voidupdateInfo(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 newTelemetryIteminstance. 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 newTelemetryIteminstance, 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 newTelemetryIteminstance, 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
-