def clock_sync(sync_id, issue_ts=None): time_stamp = time.time() args_to_log = {'sync_id': sync_id} if issue_ts: # Issuer if issue_ts is set, else reciever. assert issue_ts <= time_stamp # Convert to right units for ts. args_to_log['issue_ts'] = issue_ts * 1000000 trace_event_impl.add_trace_event( "c", time_stamp, "python", "clock_sync", args_to_log)
def clock_sync(sync_id, issue_ts=None): ''' Add a clock sync event to the trace log. Args: sync_id: ID of clock sync event. issue_ts: Time at which clock sync was issued, in microseconds. ''' time_stamp = trace_time.Now() args_to_log = {'sync_id': sync_id} if issue_ts: # Issuer if issue_ts is set, else reciever. assert issue_ts <= time_stamp args_to_log['issue_ts'] = issue_ts trace_event_impl.add_trace_event( "c", time_stamp, "python", "clock_sync", args_to_log)
def trace_end(name): trace_event_impl.add_trace_event("E", time.time(), "python", name)
def trace_begin(name, **kwargs): args_to_log = {key: repr(value) for key, value in kwargs.iteritems()} trace_event_impl.add_trace_event("B", time.time(), "python", name, args_to_log)
def trace_begin(name, **kwargs): args_to_log = {key: repr(value) for key, value in kwargs.iteritems()} trace_event_impl.add_trace_event("B", trace_time.Now(), "python", name, args_to_log)
def trace_end(name): trace_event_impl.add_trace_event("E", trace_time.Now(), "python", name)
def trace_set_thread_name(thread_name): trace_event_impl.add_trace_event("M", trace_time.Now(), "__metadata", "thread_name", {"name": thread_name})