Skip to content

Commit 47fb1f6

Browse files
committed
clean up
1 parent ce17112 commit 47fb1f6

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

splitio/models/telemetry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ def add_error(self, resource, status):
411411
:param status: http error code
412412
:type status: str
413413
"""
414+
status = str(status)
414415
with self._lock:
415416
if resource == HTTPExceptionsAndLatencies.SPLIT:
416417
if status not in self._split:

splitio/push/status_tracker.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def handle_occupancy(self, event):
8181
self._timestamps.occupancy = event.timestamp
8282

8383
self._publishers[event.channel] = event.publishers
84-
if event.channel[-3:] == 'pri':
85-
event_type = StreamingEventTypes.OCCUPANCY_PRI
86-
else:
87-
event_type = StreamingEventTypes.OCCUPANCY_SEC
88-
self._telemetry_runtime_producer.record_streaming_event((event_type, len(self._publishers), event.timestamp))
84+
self._telemetry_runtime_producer.record_streaming_event((
85+
StreamingEventTypes.OCCUPANCY_PRI if event.channel[-3:] == 'pri' else StreamingEventTypes.OCCUPANCY_SEC,
86+
len(self._publishers),
87+
event.timestamp
88+
))
8989
return self._update_status()
9090

9191
def handle_control_message(self, event):

splitio/storage/inmemmory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def record_successful_sync(self, resource, time):
532532

533533
def record_sync_error(self, resource, status):
534534
"""Record sync http error."""
535-
self._http_sync_errors.add_error(resource, str(status))
535+
self._http_sync_errors.add_error(resource, status)
536536

537537
def record_sync_latency(self, resource, latency):
538538
"""Record latency time."""

0 commit comments

Comments
 (0)