Class TelemetryCollector
java.lang.Object
com.databricks.jdbc.telemetry.latency.TelemetryCollector
Context handler for tracking telemetry details for Databricks JDBC driver. This class manages
per-statement telemetry details and provides logic for data collection.
-
Method Summary
Modifier and TypeMethodDescriptionvoidExports all pending telemetry details and clears the trackers.static TelemetryCollectorgetOrCreateTelemetryDetails(String statementId) Gets the telemetry details for a statement if present Otherwise creates a new one and persistvoidrecordChunkDownloadLatency(String statementId, long chunkIndex, long latencyMillis) Records the latency for downloading a chunk and updates metrics.voidrecordGetOperationStatus(String statementId, long latencyMillis) voidrecordOperationLatency(long latencyMillis, String methodName) voidrecordResultSetIteration(String statementId, Long totalChunks, boolean hasNext) Records when a result set is iterated/consumed.voidrecordTotalChunks(StatementId statementId, long totalChunks) voidsetResultFormat(IDatabricksStatementInternal statement, TSparkRowSetType executionResultFormat) voidsetResultFormat(StatementId statementId, com.databricks.sdk.service.sql.Format executionResultFormat)
-
Method Details
-
getInstance
-
recordChunkDownloadLatency
Records the latency for downloading a chunk and updates metrics.- Parameters:
statementId- the statement ID stringchunkIndex- the index of the chunk being downloadedlatencyMillis- the time taken to download the chunk in milliseconds
-
recordTotalChunks
-
recordOperationLatency
-
recordResultSetIteration
-
getOrCreateTelemetryDetails
Gets the telemetry details for a statement if present Otherwise creates a new one and persist- Parameters:
statementId- the statement ID
-
exportAllPendingTelemetryDetails
public void exportAllPendingTelemetryDetails()Exports all pending telemetry details and clears the trackers. This method is called when the connection/client is being closed. -
recordGetOperationStatus
-
setResultFormat
public void setResultFormat(IDatabricksStatementInternal statement, TSparkRowSetType executionResultFormat) -
setResultFormat
public void setResultFormat(StatementId statementId, com.databricks.sdk.service.sql.Format executionResultFormat)
-