Package net.snowflake.client.jdbc.telemetry

## Class TelemetryUtil

- java.lang.Object
- - net.snowflake.client.jdbc.telemetry.TelemetryUtil

    public class TelemetryUtil
    extends Object

### Field Summary

Fields
`static int` `NO_VENDOR_CODE`
`static String` `QUERY_ID` Deprecated.
`static String` `TYPE` Deprecated.
`static String` `VALUE` Deprecated.

### Constructor Summary

Constructors
`TelemetryUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static TelemetryData` `buildCrlData​(String crlUrl, long crlBytes, int revokedCertificates, long downloadTime, long parseTime)`
`static TelemetryData` `buildJobData​(com.fasterxml.jackson.databind.node.ObjectNode obj)`
`static TelemetryData` `buildJobData​(String queryId, TelemetryField field, long value)` Create a simple TelemetryData instance for Job metrics using given parameters
`static com.fasterxml.jackson.databind.node.ObjectNode` `createIBValue​(String queryId, String sqlState, int errorNumber, TelemetryField type, String errorMessage, String reason)` Helper function to create ObjectNode for IB telemetry log

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### NO_VENDOR_CODE

    public static final int NO_VENDOR_CODE

See Also:
  Constant Field Values

#### TYPE

    @Deprecated
    public static final String TYPE

Deprecated.

See Also:
  Constant Field Values

#### QUERY_ID

    @Deprecated
    public static final String QUERY_ID

Deprecated.

See Also:
  Constant Field Values

#### VALUE

    @Deprecated
    public static final String VALUE

Deprecated.

See Also:
  Constant Field Values

### Constructor Detail

#### TelemetryUtil

    public TelemetryUtil()

### Method Detail

#### buildJobData

    public static TelemetryData buildJobData​(String queryId,
                                             TelemetryField field,
                                             long value)

Create a simple TelemetryData instance for Job metrics using given parameters

Parameters:
  `queryId` - the id of the query
  `field` - the field to log (represents the "type" field in telemetry)
  `value` - the value to log for the field
Returns:
  TelemetryData instance constructed from parameters

#### buildJobData

    public static TelemetryData buildJobData​(com.fasterxml.jackson.databind.node.ObjectNode obj)

#### createIBValue

    public static com.fasterxml.jackson.databind.node.ObjectNode createIBValue​(String queryId,
                                                                               String sqlState,
                                                                               int errorNumber,
                                                                               TelemetryField type,
                                                                               String errorMessage,
                                                                               String reason)

Helper function to create ObjectNode for IB telemetry log

Parameters:
  `queryId` - query ID
  `sqlState` - the SQL state
  `errorNumber` - the error number
Returns:
  ObjectNode for IB telemetry log

#### buildCrlData

    @SnowflakeJdbcInternalApi
    public static TelemetryData buildCrlData​(String crlUrl,
                                             long crlBytes,
                                             int revokedCertificates,
                                             long downloadTime,
                                             long parseTime)