Skip to content

Commit 27e4ae5

Browse files
committed
removed client side metrics
1 parent e6189cb commit 27e4ae5

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

splitio/client/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def get_factory(api_key, **kwargs):
545545
_INSTANTIATED_FACTORIES.update([api_key])
546546
_INSTANTIATED_FACTORIES_LOCK.release()
547547

548-
def _get_active_and_derundant_count():
548+
def _get_active_and_redundant_count():
549549
redundant_factory_count = 0
550550
active_factory_count = 0
551551
_INSTANTIATED_FACTORIES_LOCK.acquire()

splitio/engine/telemetry.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ def get_config_stats_to_json(self):
166166
'rF': config_stats['redundantFactoryCount'],
167167
'bT': config_stats['blockUntilReadyTimeout'],
168168
'nR': config_stats['notReady'],
169-
'uC': config_stats['userConsent'],
170169
'tR': config_stats['timeUntilReady']}
171170
)
172171

@@ -264,7 +263,6 @@ def pop_formatted_stats(self):
264263
**{'eD': self.get_events_stats('eventsDropped')},
265264
**{'lS': {'sp': last_synchronization['split'],
266265
'se': last_synchronization['segment'],
267-
'ms': last_synchronization['mySegment'],
268266
'im': last_synchronization['impression'],
269267
'ic': last_synchronization['impressionCount'],
270268
'ev': last_synchronization['event'],
@@ -274,7 +272,6 @@ def pop_formatted_stats(self):
274272
**{'t': self.pop_tags()},
275273
**{'hE': {'sp': http_errors['split'],
276274
'se': http_errors['segment'],
277-
'ms': http_errors['mySegment'],
278275
'im': http_errors['impression'],
279276
'ic': http_errors['impressionCount'],
280277
'ev': http_errors['event'],
@@ -283,7 +280,6 @@ def pop_formatted_stats(self):
283280
},
284281
**{'hL': {'sp': http_latencies['split'],
285282
'se': http_latencies['segment'],
286-
'ms': http_latencies['mySegment'],
287283
'im': http_latencies['impression'],
288284
'ic': http_latencies['impressionCount'],
289285
'ev': http_latencies['event'],

splitio/storage/inmemmory.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,16 @@ def _reset_counters(self):
466466
self._counters = {'impressionsQueued': 0, 'impressionsDeduped': 0, 'impressionsDropped': 0, 'eventsQueued': 0, 'eventsDropped': 0,
467467
'authRejections': 0, 'tokenRefreshes': 0}
468468
self._exceptions = {'methodExceptions': {'treatment': 0, 'treatments': 0, 'treatmentWithConfig': 0, 'treatmentsWithConfig': 0, 'track': 0}}
469-
self._records = {'lastSynchronizations': {'split': 0, 'segment': 0, 'mySegment': 0, 'impression': 0, 'impressionCount': 0, 'event': 0, 'telemetry': 0, 'token': 0},
469+
self._records = {'lastSynchronizations': {'split': 0, 'segment': 0, 'impression': 0, 'impressionCount': 0, 'event': 0, 'telemetry': 0, 'token': 0},
470470
'sessionLength': 0}
471-
self._http_errors = {'split': {}, 'segment': {}, 'mySegment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
472-
self._config = {'blockUntilReadyTimeout':0, 'notReady':0, 'userConsent': 0, 'timeUntilReady': 0}
471+
self._http_errors = {'split': {}, 'segment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
472+
self._config = {'blockUntilReadyTimeout':0, 'notReady':0, 'timeUntilReady': 0}
473473
self._streaming_events = []
474474
self._tags = []
475-
self._integrations = {}
476475

477476
def _reset_latencies(self):
478477
self._latencies = {'methodLatencies': {'treatment': [], 'treatments': [], 'treatmentWithConfig': [], 'treatmentsWithConfig': [], 'track': []},
479-
'httpLatencies': {'split': [], 'segment': [], 'mySegment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}}
478+
'httpLatencies': {'split': [], 'segment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}}
480479

481480
def record_config(self, config):
482481
"""Record configurations."""
@@ -630,14 +629,14 @@ def pop_http_errors(self):
630629
"""Get and reset http errors."""
631630
with self._lock:
632631
https_errors = self._http_errors
633-
self._http_errors = {'split': {}, 'segment': {}, 'mySegment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
632+
self._http_errors = {'split': {}, 'segment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
634633
return https_errors
635634

636635
def pop_http_latencies(self):
637636
"""Get and reset http latencies."""
638637
with self._lock:
639638
latencies = self._latencies['httpLatencies']
640-
self._latencies['httpLatencies'] = {'split': [], 'segment': [], 'mySegment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}
639+
self._latencies['httpLatencies'] = {'split': [], 'segment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}
641640
return latencies
642641

643642
def pop_auth_rejections(self):

tests/storage/test_inmemory_storage.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -403,16 +403,15 @@ def test_resets(self):
403403
assert(storage._counters == {'impressionsQueued': 0, 'impressionsDeduped': 0, 'impressionsDropped': 0, 'eventsQueued': 0, 'eventsDropped': 0,
404404
'authRejections': 0, 'tokenRefreshes': 0})
405405
assert(storage._exceptions == {'methodExceptions': {'treatment': 0, 'treatments': 0, 'treatmentWithConfig': 0, 'treatmentsWithConfig': 0, 'track': 0}})
406-
assert(storage._records == {'lastSynchronizations': {'split': 0, 'segment': 0, 'mySegment': 0, 'impression': 0, 'impressionCount': 0, 'event': 0, 'telemetry': 0, 'token': 0},
406+
assert(storage._records == {'lastSynchronizations': {'split': 0, 'segment': 0, 'impression': 0, 'impressionCount': 0, 'event': 0, 'telemetry': 0, 'token': 0},
407407
'sessionLength': 0})
408-
assert(storage._http_errors == {'split': {}, 'segment': {}, 'mySegment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}})
409-
assert(storage._config == {'blockUntilReadyTimeout':0, 'notReady':0, 'userConsent': 0, 'timeUntilReady': 0})
408+
assert(storage._http_errors == {'split': {}, 'segment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}})
409+
assert(storage._config == {'blockUntilReadyTimeout':0, 'notReady':0, 'timeUntilReady': 0})
410410
assert(storage._streaming_events == [])
411411
assert(storage._tags == [])
412-
assert(storage._integrations == {})
413412

414413
assert(storage._latencies == {'methodLatencies': {'treatment': [], 'treatments': [], 'treatmentWithConfig': [], 'treatmentsWithConfig': [], 'track': []},
415-
'httpLatencies': {'split': [], 'segment': [], 'mySegment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}})
414+
'httpLatencies': {'split': [], 'segment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []}})
416415

417416
def test_record_config(self):
418417
storage = InMemoryTelemetryStorage()
@@ -445,8 +444,7 @@ def test_record_config(self):
445444
'blockUntilReadyTimeout': 0,
446445
'timeUntilReady': 0,
447446
'notReady': 0,
448-
'redundantFactoryCount': 0,
449-
'userConsent': 0}
447+
'redundantFactoryCount': 0}
450448
)
451449

452450
def test_record_counters(self):
@@ -541,9 +539,9 @@ def test_pop_counters(self):
541539
[storage.record_sync_error('token', '502') for i in range(5)]
542540
http_errors = storage.pop_http_errors()
543541
assert(http_errors == {'split': {'400': 1, '401': 1, '402': 1}, 'segment': {'500': 1, '501': 1, '502': 1},
544-
'mySegment': {}, 'impression': {'502': 1}, 'impressionCount': {'501': 1, '502': 1},
542+
'impression': {'502': 1}, 'impressionCount': {'501': 1, '502': 1},
545543
'event': {'501': 1}, 'telemetry': {'505': 1}, 'token': {'502': 5}})
546-
assert(storage._http_errors == {'split': {}, 'segment': {}, 'mySegment': {}, 'impression': {},
544+
assert(storage._http_errors == {'split': {}, 'segment': {}, 'impression': {},
547545
'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}})
548546

549547
storage.record_auth_rejections()
@@ -587,7 +585,7 @@ def test_pop_latencies(self):
587585
[storage.record_sync_latency('telemetry', i) for i in [100, 50, 160]]
588586
[storage.record_sync_latency('token', i) for i in [10, 15, 100]]
589587
sync_latency = storage.pop_http_latencies()
590-
assert(storage._latencies['httpLatencies'] == {'split': [], 'segment': [], 'mySegment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []})
591-
assert(sync_latency == {'split': [50, 10, 20, 40], 'segment': [70, 100, 40, 30], 'mySegment': [],
588+
assert(storage._latencies['httpLatencies'] == {'split': [], 'segment': [], 'impression': [], 'impressionCount': [], 'event': [], 'telemetry': [], 'token': []})
589+
assert(sync_latency == {'split': [50, 10, 20, 40], 'segment': [70, 100, 40, 30],
592590
'impression': [10, 20], 'impressionCount': [5, 10], 'event': [50, 40],
593591
'telemetry': [100, 50, 160], 'token': [10, 15, 100]})

tests/sync/test_telemetry.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ def test_synchronize_telemetry(self, mocker):
4141
'authRejections': 1, 'tokenRefreshes': 3}
4242
telemetry_storage._exceptions = {'methodExceptions': {'treatment': 1, 'treatments': 0,
4343
'treatmentWithConfig': 5, 'treatmentsWithConfig': 0, 'track': 3}}
44-
telemetry_storage._records = {'lastSynchronizations': {'split': 5, 'segment': 3, 'mySegment': 0,
44+
telemetry_storage._records = {'lastSynchronizations': {'split': 5, 'segment': 3,
4545
'impression': 10, 'impressionCount': 0, 'event': 4,
4646
'telemetry': 0, 'token': 3},'sessionLength': 3}
47-
telemetry_storage._http_errors = {'split': {'500': 3}, 'segment': {}, 'mySegment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
48-
telemetry_storage._config = {'blockUntilReadyTimeout': 10, 'notReady': 0, 'userConsent': 0, 'timeUntilReady': 1}
47+
telemetry_storage._http_errors = {'split': {'500': 3}, 'segment': {}, 'impression': {}, 'impressionCount': {}, 'event': {}, 'telemetry': {}, 'token': {}}
48+
telemetry_storage._config = {'blockUntilReadyTimeout': 10, 'notReady': 0, 'timeUntilReady': 1}
4949
telemetry_storage._streaming_events = []
5050
telemetry_storage._tags = ['tag1']
5151
telemetry_storage._integrations = {}
5252
telemetry_storage._latencies = {'methodLatencies': {'treatment': [10, 20], 'treatments': [50], 'treatmentWithConfig': [], 'treatmentsWithConfig': [], 'track': []},
53-
'httpLatencies': {'split': [200, 300], 'segment': [400], 'mySegment': [], 'impression': [], 'impressionCount': [200], 'event': [], 'telemetry': [], 'token': []}}
53+
'httpLatencies': {'split': [200, 300], 'segment': [400], 'impression': [], 'impressionCount': [200], 'event': [], 'telemetry': [], 'token': []}}
5454

5555
telemetry_storage.record_config({'operationMode': 'inmemory',
5656
'streamingEnabled': True,
@@ -85,10 +85,10 @@ def record_stats(*args, **kwargs):
8585
"iDr": 3,
8686
"eQ": 0,
8787
"eD": 10,
88-
"lS": {"sp": 5, "se": 3, "ms": 0, "im": 10, "ic": 0, "ev": 4, "te": 0, "to": 3},
88+
"lS": {"sp": 5, "se": 3, "im": 10, "ic": 0, "ev": 4, "te": 0, "to": 3},
8989
"t": ['tag1'],
90-
"hE": {"sp": {'500': 3}, "se": {}, "ms": {}, "im": {}, "ic": {}, "ev": {}, "te": {}, "to": {}},
91-
"hL": {"sp": [200, 300], "se": [400], "ms": [], "im": [], "ic": [200], "ev": [], "te": [], "to": []},
90+
"hE": {"sp": {'500': 3}, "se": {}, "im": {}, "ic": {}, "ev": {}, "te": {}, "to": {}},
91+
"hL": {"sp": [200, 300], "se": [400], "im": [], "ic": [200], "ev": [], "te": [], "to": []},
9292
"aR": 1,
9393
"tR": 3,
9494
"sE": [],

0 commit comments

Comments
 (0)