dak.graph_new

Generate an HTML page and PNG charts wih the age of packages in NEW

To be run once a day.

The tool stores persistent status in the RRD database and the pickeled queue in order to speed up daily runs. Directories and database files are created as needed.

If the RRD directory is deleted the script rebuilds past years from the historical logs, and that can take a while, otherwise it just parses fresh data.

Functions

debug(msg)

Verbose messages for debugging

extract_queue_events(log_dir, last_update)

Extracts NEW queue events from log files

gen_stats(t, q)

Extract percentiles of package ages

generate_output(rrdfn, out_dir, init_time)

Generate png charts and index.html in the output directory

init_rrd(rrdfn, t)

Initialize empty RRD

main([verbose_debug])

plot_graph(out_dir, fname, rrdfn, start, ...)

process_events(events, last_update, ...)

Process logged events like ACCEPT-TO-NEW, ACCEPT, REJECT and update the RRD database accordingly

skip_file(fn, last_update)

Skip files that are already processed

usage([exit_code])

write_index(out_dir)

Generates index.html page in the output directory

dak.graph_new._handle_conf() tuple[source]

Load configuration parameters from Cnf

dak.graph_new.debug(msg: str) None[source]

Verbose messages for debugging

dak.graph_new.extract_queue_events(log_dir: str, last_update: Optional[datetime]) Iterator[tuple][source]

Extracts NEW queue events from log files

dak.graph_new.gen_stats(t: datetime, q: dict) tuple[source]

Extract percentiles of package ages

dak.graph_new.generate_output(rrdfn: str, out_dir: str, init_time) None[source]

Generate png charts and index.html in the output directory

dak.graph_new.init_rrd(rrdfn: str, t: datetime) None[source]

Initialize empty RRD

dak.graph_new.main(verbose_debug=False) None[source]
dak.graph_new.plot_graph(out_dir: str, fname: str, rrdfn: str, start, end: datetime, title: str) None[source]
dak.graph_new.process_events(events, last_update: Optional[datetime], init_time: Optional[datetime], queue) tuple[source]

Process logged events like ACCEPT-TO-NEW, ACCEPT, REJECT and update the RRD database accordingly

dak.graph_new.skip_file(fn: str, last_update) bool[source]

Skip files that are already processed

dak.graph_new.usage(exit_code=0) None[source]
dak.graph_new.write_index(out_dir: str) None[source]

Generates index.html page in the output directory