MCPcopy Index your code
hub / github.com/Tong89/smartNode / append

Method append

backend/persistence/event_log.py:27–36  ·  view source on GitHub ↗
(self, event_type, request_id=None, **fields)

Source from the content-addressed store, hash-verified

25 self._buffer = [] # 内存镜像(便于查询/测试)
26
27 def append(self, event_type, request_id=None, **fields):
28 record = {"ts": time.time(), "type": event_type, "request_id": request_id}
29 record.update(fields)
30 line = json.dumps(record, ensure_ascii=False)
31 with self._lock:
32 self._buffer.append(record)
33 if self.path:
34 with open(self.path, "a", encoding="utf-8") as f:
35 f.write(line + "\n")
36 return record
37
38 def events(self, request_id=None, event_type=None):
39 with self._lock:

Callers 15

test_event_log_trimFunction · 0.95
importScenarioFunction · 0.80
validate_configFunction · 0.80
checkMethod · 0.80
_rebuild_requestsMethod · 0.80
validateMethod · 0.80
core.pyFile · 0.80
_simulation_loopMethod · 0.80
_update_transmissionsMethod · 0.80

Calls

no outgoing calls