예제 #1
0
 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)
예제 #2
0
  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)
예제 #3
0
 def trace_end(name):
   trace_event_impl.add_trace_event("E", time.time(), "python", name)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 def trace_end(name):
     trace_event_impl.add_trace_event("E", trace_time.Now(), "python", name)
예제 #7
0
 def trace_set_thread_name(thread_name):
   trace_event_impl.add_trace_event("M", trace_time.Now(), "__metadata",
                                    "thread_name", {"name": thread_name})
예제 #8
0
 def trace_set_thread_name(thread_name):
     trace_event_impl.add_trace_event("M", trace_time.Now(), "__metadata",
                                      "thread_name", {"name": thread_name})