Skip to content

Commit

Permalink
Remove gauges from analytics abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Dec 11, 2024
1 parent 3fe797f commit d4e6e20
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
2 changes: 0 additions & 2 deletions temba/channels/android/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def register(request):
@csrf_exempt
@transaction.non_atomic_requests
def sync(request, channel_id):
start = time.time()

if request.method != "POST":
return HttpResponse(status=500, content="POST Required")

Expand Down
21 changes: 0 additions & 21 deletions temba/utils/analytics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class AnalyticsBackend(metaclass=abc.ABCMeta):
slug: str = None
hook_templates = {}

def gauges(self, values: dict):
"""
Records gauge values
"""

def track(self, user, event: str, properties: dict):
"""
Tracks a user event
Expand Down Expand Up @@ -52,11 +47,6 @@ class ConsoleBackend(AnalyticsBackend):

slug = "console"

def gauges(self, values: dict):
if not settings.TESTING: # pragma: no cover
for name, value in values.items():
print(f"[analytics] gauge={name} value={value}")

def track(self, user, event: str, properties: dict):
if not settings.TESTING: # pragma: no cover
print(f"[analytics] event={event} user={user.email}")
Expand All @@ -68,17 +58,6 @@ def get_backends() -> list:
return list(backends.values())


def gauges(values: dict):
"""
Reports a gauge value
"""
for backend in get_backends():
try:
backend.gauges(values)
except Exception:
logger.exception(f"error reporting gauges on {backend.slug}")


def identify(user, brand, org):
"""
Creates and identifies a new user to our analytics backends
Expand Down
3 changes: 0 additions & 3 deletions temba/utils/analytics/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ class BadBackend(AnalyticsBackend):
slug = "bad"
hook_templates = {"frame-top": "bad/frame_top.html"}

def gauges(self, values: dict):
raise ValueError("boom")

def track(self, user, event: str, properties: dict):
raise ValueError("boom")

Expand Down

0 comments on commit d4e6e20

Please sign in to comment.