Skip to content

Commit

Permalink
disabling oob
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aling committed Jul 10, 2024
1 parent b1e65ed commit a2ace61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 242 deletions.
14 changes: 3 additions & 11 deletions src/snowflake/connector/telemetry_oob.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import logging
import uuid
from collections import namedtuple
from enum import Enum
from queue import Queue
from threading import Lock
from typing import Any
Expand All @@ -25,16 +24,9 @@
logger = logging.getLogger(__name__)


class _OOBTelemetryLevel(Enum):
OFF = 0
ERROR = 1
ALL = 2


DEFAULT_BATCH_SIZE = 10
DEFAULT_NUM_OF_RETRY_TO_TRIGGER_TELEMETRY = 10
REQUEST_TIMEOUT = 3
_OOB_TELEMETRY_LEVEL = _OOBTelemetryLevel.OFF

TelemetryAPI = namedtuple("TelemetryAPI", ["url", "api_key"])
TelemetryServer = namedtuple("TelemetryServer", ["name", "url", "api_key"])
Expand Down Expand Up @@ -181,7 +173,7 @@ def __init__(self) -> None:
raise Exception("This class is a singleton!")
else:
TelemetryService.__instance = self
self._enabled = True
self._enabled = False
self._queue = Queue()
self.batch_size = DEFAULT_BATCH_SIZE
self.num_of_retry_to_trigger_telemetry = (
Expand All @@ -201,11 +193,11 @@ def __del__(self) -> None:
@property
def enabled(self) -> bool:
"""Whether the Telemetry service is enabled or not."""
return self._enabled and _OOB_TELEMETRY_LEVEL != _OOBTelemetryLevel.OFF
return False

def enable(self) -> None:
"""Enable Telemetry Service."""
self._enabled = True
self._enabled = False

def disable(self) -> None:
"""Disable Telemetry Service."""
Expand Down
231 changes: 0 additions & 231 deletions test/unit/test_telemetry_oob.py

This file was deleted.

0 comments on commit a2ace61

Please sign in to comment.