MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _create_event

Method _create_event

serving/tools/timeline/timeline.py:64–88  ·  view source on GitHub ↗

Creates a new Chrome Trace event. For details of the file format, see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args: ph: The type of event - usually a single character. category: The event category as a string. name: The event name

(self, ph, category, name, pid, tid, timestamp)

Source from the content-addressed store, hash-verified

62 self._metadata = []
63
64 def _create_event(self, ph, category, name, pid, tid, timestamp):
65 """Creates a new Chrome Trace event.
66
67 For details of the file format, see:
68 https://github.com/catapult-project/catapult/blob/master/tracing/README.md
69
70 Args:
71 ph: The type of event - usually a single character.
72 category: The event category as a string.
73 name: The event name as a string.
74 pid: Identifier of the process generating this event as an integer.
75 tid: Identifier of the thread generating this event as an integer.
76 timestamp: The timestamp of this event as a long integer.
77
78 Returns:
79 A JSON compatible event object.
80 """
81 event = {}
82 event['ph'] = ph
83 event['cat'] = category
84 event['name'] = name
85 event['pid'] = pid
86 event['tid'] = tid
87 event['ts'] = timestamp
88 return event
89
90 def emit_pid(self, name, pid):
91 """Adds a process metadata event to the trace.

Callers 10

emit_regionMethod · 0.95
emit_obj_createMethod · 0.95
emit_obj_deleteMethod · 0.95
emit_obj_snapshotMethod · 0.95
emit_flow_startMethod · 0.95
emit_flow_endMethod · 0.95
emit_flow_type_startMethod · 0.95
emit_flow_type_endMethod · 0.95
emit_counterMethod · 0.95
emit_countersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected