MCPcopy
hub / github.com/docling-project/docling / load_points

Function load_points

perfs/plot_memory_metrics.py:89–109  ·  view source on GitHub ↗
(
    metrics_file: Path,
)

Source from the content-addressed store, hash-verified

87
88
89def load_points(
90 metrics_file: Path,
91) -> tuple[list[int], dict[str, list[float]]]:
92 total_pages: list[int] = []
93 loaded_metrics = _empty_series()
94
95 with metrics_file.open(encoding="utf-8") as fp:
96 for line in fp:
97 payload = json.loads(line)
98 event = payload.get("event")
99 total_page_no = payload.get("total_page_no")
100 if not isinstance(total_page_no, int):
101 continue
102
103 if event == "loaded":
104 memory_loaded = payload.get("memory_loaded_mb")
105 if isinstance(memory_loaded, dict):
106 total_pages.append(total_page_no)
107 _append_memory_values(loaded_metrics, memory_loaded)
108
109 return total_pages, loaded_metrics
110
111
112def main() -> None:

Callers 1

mainFunction · 0.85

Calls 2

_empty_seriesFunction · 0.85
_append_memory_valuesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…