Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: common/py_trace_event/py_trace_event/trace_event_impl/log.py

Issue 2301523007: Add trace events for some of telemetry internal functions (Closed)
Patch Set: Address Petr's nit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/py_trace_event/py_trace_event/trace_event_impl/log.py
diff --git a/common/py_trace_event/py_trace_event/trace_event_impl/log.py b/common/py_trace_event/py_trace_event/trace_event_impl/log.py
index 8ed2529643e10907da664786f2a06191a096c23e..95d012f32121d159e14dcd42792e13dcbaa0f1ca 100644
--- a/common/py_trace_event/py_trace_event/trace_event_impl/log.py
+++ b/common/py_trace_event/py_trace_event/trace_event_impl/log.py
@@ -8,6 +8,8 @@ import sys
import time
import threading
+from py_trace_event import trace_time
+
from py_utils import lock
@@ -87,7 +89,7 @@ def _trace_enable(log_file=None):
tid = os.getpid()
x = {"ph": "M", "category": "process_argv",
"pid": os.getpid(), "tid": threading.current_thread().ident,
- "ts": time.time(),
+ "ts": trace_time.Now(),
"name": "process_argv", "args": {"argv": sys.argv}}
_log_file.write("%s\n" % json.dumps(x))
else:
@@ -164,10 +166,10 @@ def add_trace_event(ph, ts, category, name, args=None):
"args": args or {}});
def trace_begin(name, args=None):
- add_trace_event("B", time.time(), "python", name, args)
+ add_trace_event("B", trace_time.Now(), "python", name, args)
def trace_end(name, args=None):
- add_trace_event("E", time.time(), "python", name, args)
+ add_trace_event("E", trace_time.Now(), "python", name, args)
def _trace_disable_atexit():
trace_disable()

Powered by Google App Engine
This is Rietveld 408576698