mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Fix last metrics for task are updated for events reported without variants
This commit is contained in:
parent
6112910768
commit
85f5b8b6f6
@ -438,10 +438,8 @@ class EventBLL(object):
|
|||||||
last_events contains [hashed_metric_name -> hashed_variant_name -> event]. Keys are hashed to avoid mongodb
|
last_events contains [hashed_metric_name -> hashed_variant_name -> event]. Keys are hashed to avoid mongodb
|
||||||
key conflicts due to invalid characters and/or long field names.
|
key conflicts due to invalid characters and/or long field names.
|
||||||
"""
|
"""
|
||||||
metric = event.get("metric")
|
metric = event.get("metric") or ""
|
||||||
variant = event.get("variant")
|
variant = event.get("variant") or ""
|
||||||
if not (metric and variant):
|
|
||||||
return
|
|
||||||
|
|
||||||
metric_hash = dbutils.hash_field_name(metric)
|
metric_hash = dbutils.hash_field_name(metric)
|
||||||
variant_hash = dbutils.hash_field_name(variant)
|
variant_hash = dbutils.hash_field_name(variant)
|
||||||
@ -486,9 +484,9 @@ class EventBLL(object):
|
|||||||
recent than the currently stored event for its metric/event_type combination.
|
recent than the currently stored event for its metric/event_type combination.
|
||||||
last_events contains [metric_name -> event_type -> event]
|
last_events contains [metric_name -> event_type -> event]
|
||||||
"""
|
"""
|
||||||
metric = event.get("metric")
|
metric = event.get("metric") or ""
|
||||||
event_type = event.get("type")
|
event_type = event.get("type")
|
||||||
if not (metric and event_type):
|
if not event_type:
|
||||||
return
|
return
|
||||||
|
|
||||||
timestamp = last_events[metric][event_type].get("timestamp", None)
|
timestamp = last_events[metric][event_type].get("timestamp", None)
|
||||||
|
@ -193,7 +193,7 @@ class TestTaskEvents(TestService):
|
|||||||
|
|
||||||
def test_last_scalar_metrics(self):
|
def test_last_scalar_metrics(self):
|
||||||
metric = "Metric1"
|
metric = "Metric1"
|
||||||
variant = "Variant1"
|
for variant in ("Variant1", None):
|
||||||
iter_count = 100
|
iter_count = 100
|
||||||
task = self._temp_task()
|
task = self._temp_task()
|
||||||
events = [
|
events = [
|
||||||
|
Loading…
Reference in New Issue
Block a user