MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / main

Function main

tests/loadtest/tools/dashboard.py:126–151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124
125
126def main() -> int:
127 args = parse_args()
128 scan_root = Path(args.root).resolve()
129 if not scan_root.exists():
130 print(f"Scan root does not exist: {scan_root}", file=sys.stderr)
131 return 1
132 if not DASHBOARD_DIR.exists():
133 print(f"Dashboard assets are missing: {DASHBOARD_DIR}", file=sys.stderr)
134 return 1
135
136 server = ThreadingHTTPServer((args.host, args.port), build_handler(scan_root))
137 url = f"http://{args.host}:{args.port}/dashboard/"
138
139 if not args.no_open:
140 threading.Timer(0.2, lambda: webbrowser.open(url)).start()
141
142 print(f"Benchmark dashboard serving {scan_root}")
143 print(f"Open {url}")
144
145 try:
146 server.serve_forever()
147 except KeyboardInterrupt:
148 print("\nShutting down dashboard server.")
149 finally:
150 server.server_close()
151 return 0
152
153
154if __name__ == "__main__":

Callers 1

dashboard.pyFile · 0.70

Calls 2

parse_argsFunction · 0.85
build_handlerFunction · 0.85

Tested by

no test coverage detected