diff --git a/lyrebird/event.py b/lyrebird/event.py index abb32a50..3d148877 100644 --- a/lyrebird/event.py +++ b/lyrebird/event.py @@ -80,7 +80,9 @@ def broadcast_handler(self, callback_fn, event, args, kwargs): finally: event_end_time = time.time() event_duration = (event_end_time - event_start_time) * 1000 - if event.channel != 'lyrebird_metrics': + # Report the operation of Event + # Prevent loop reporting, and only time-consuming event(more than 1ms) are reported + if event.channel != 'lyrebird_metrics' and event_duration > 1: trace_info = { 'channel': event.channel, 'callback_fn': callback_fn.__name__, diff --git a/lyrebird/version.py b/lyrebird/version.py index a6642b7b..fdac5079 100644 --- a/lyrebird/version.py +++ b/lyrebird/version.py @@ -1,3 +1,3 @@ -IVERSION = (2, 26, 2) +IVERSION = (2, 26, 3) VERSION = ".".join(str(i) for i in IVERSION) LYREBIRD = "Lyrebird " + VERSION diff --git a/tests/test_db.py b/tests/test_db.py index 646d5cbd..461a83d5 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -54,7 +54,7 @@ def test_reset(event_server, task_server, db_server): event_server.publish(channel_name, message) time.sleep(0.2) events = db_server.get_event([]) - assert len(events) == publish_time*2 + assert len(events) == publish_time db_server.reset() events = db_server.get_event([]) @@ -64,7 +64,7 @@ def test_reset(event_server, task_server, db_server): event_server.publish(channel_name, message) time.sleep(0.2) events = db_server.get_event([]) - assert len(events) == publish_time*2 + assert len(events) == publish_time def test_get_event_with_multiple_search_str(event_server, task_server, db_server):