net.snowflake.client.jdbc.telemetry

## Class Telemetry

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

    public class Telemetry
    extends Object

Copyright (c) 2018 Snowflake Computing Inc. All rights reserved.

Telemetry Service Interface

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addLogToBatch(com.fasterxml.jackson.databind.node.ObjectNode message, long timeStamp)`
`void` `addLogToBatch(TelemetryData log)` Add a log data to batch
`int` `bufferSize()` For test use only
`void` `close()` close telemetry connector, send all cached logs
`static Telemetry` `createTelemetry(Connection conn)`
`static Telemetry` `createTelemetry(Connection conn, int flushSize)` Initialize the telemetry connector
`static Telemetry` `createTelemetry(SFSession session)` Initialize the telemetry connector
`static Telemetry` `createTelemetry(SFSession session, int flushSize)`
`void` `disableTelemetry()`
`boolean` `isClosed()`
`boolean` `isTelemetryEnabled()`
`LinkedList<TelemetryData>` `logBuffer()` For test use only
`boolean` `sendBatch()` Send all cached logs to server
`boolean` `sendLog(com.fasterxml.jackson.databind.node.ObjectNode message, long timeStamp)`
`boolean` `sendLog(TelemetryData log)` Send a log data to server

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

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

### Method Detail

#### isTelemetryEnabled

    public boolean isTelemetryEnabled()

#### disableTelemetry

    public void disableTelemetry()

#### createTelemetry

    public static Telemetry createTelemetry(Connection conn,
                                            int flushSize)

Initialize the telemetry connector

Parameters:
  `conn` -
Returns:

#### createTelemetry

    public static Telemetry createTelemetry(Connection conn)

#### createTelemetry

    public static Telemetry createTelemetry(SFSession session)

Initialize the telemetry connector

Parameters:
  `session` -
Returns:

#### createTelemetry

    public static Telemetry createTelemetry(SFSession session,
                                            int flushSize)

#### addLogToBatch

    public void addLogToBatch(TelemetryData log)
                       throws IOException

Add a log data to batch

Throws:
  `IOException`

#### addLogToBatch

    public void addLogToBatch(com.fasterxml.jackson.databind.node.ObjectNode message,
                              long timeStamp)
                       throws IOException

Throws:
  `IOException`

#### close

    public void close()
               throws IOException

close telemetry connector, send all cached logs

Throws:
  `IOException`

#### isClosed

    public boolean isClosed()

#### sendBatch

    public boolean sendBatch()
                      throws IOException

Send all cached logs to server

Throws:
  `IOException`

#### sendLog

    public boolean sendLog(TelemetryData log)
                    throws IOException

Send a log data to server

Throws:
  `IOException`

#### sendLog

    public boolean sendLog(com.fasterxml.jackson.databind.node.ObjectNode message,
                           long timeStamp)
                    throws IOException

Throws:
  `IOException`

#### bufferSize

    public int bufferSize()

For test use only

Returns:
  the number of cached logs

#### logBuffer

    public LinkedList<TelemetryData> logBuffer()

For test use only

Returns:
  a copy of the logs currently in the buffer