210 """Main entry point for the collector script."""
211 parser = argparse.ArgumentParser(
212 description=
"Collect and aggregate MergeROOT statistics from JSON files.",
213 formatter_class=argparse.RawDescriptionHelpFormatter,
216 # Collect stats from current directory
217 hps-mc-collect-merge-stats .
219 # Collect stats and write summary to file
220 hps-mc-collect-merge-stats /path/to/output -o summary.json
223 hps-mc-collect-merge-stats . -p "**/merge_*_stats.json"
225 # Quiet mode (single line output)
226 hps-mc-collect-merge-stats . -q
232 help=
"Directory to search for stats files"
236 help=
"Output JSON file for aggregated summary"
240 default=
"**/*_stats.json",
241 help=
"Glob pattern for stats files (default: **/*_stats.json)"
246 help=
"Quiet mode - only print summary line"
249 args = parser.parse_args()
252 if not os.path.isdir(args.directory):
253 print(
"ERROR: Directory not found: %s" % args.directory, file=sys.stderr)
258 stats_files = collector.find_stats_files()
261 print(
"WARNING: No stats files found matching pattern '%s' in %s" % (
262 args.pattern, args.directory), file=sys.stderr)
267 collector.print_report(quiet=args.quiet)
271 collector.write_summary(args.output)
273 print(
"Summary written to: %s" % args.output)
276 if collector.summary[
"summary"][
"all_validations_passed"]: