Skip to content

Report how many beliefs a job computed as well as how many it saved #2821

Closed

Description

@Flix6x

In v1.1.0, #2689 (with #2571) changed the result of reporting and scheduling jobs to count the beliefs they saved, rather than those they computed:

  • save_generator_results returns, per output, {"sensor_id": ..., "n_rows": ...}, where n_rows is the number of beliefs saved;
  • a reporting job (and a plugin automation's job) returns that list as its result;
  • a scheduling job sums it into the num-beliefs field of its result (GET /api/v3_0/jobs/<uuid>).

The computed count is no longer returned at all. That loses information: a result that says "0 saved" cannot tell a run that computed nothing from a run that only repeated what was already on record. The CLI and the worker's log work around this by recounting the computed data themselves.

Proposal

Return both counts, additively and backwards compatibly:

  • keep the saved counts (n_rows per output, num-beliefs on a schedule) with their v1.1.0 meaning;
  • add the computed count next to each: n_computed per output, and num-computed-beliefs on a schedule's result (kebab-case, like its neighbours);
  • "computed" means the beliefs the data generator returned, before NaN values and beliefs that repeat what is on record are left out;
  • say both where the CLI and the log say only what was saved, e.g. "computed N, saved M (the rest was already on record)".

Since the meaning of these counts changed within v1.1.0, which is unreleased, the existing changelog entry for #2689/#2571 can be extended rather than adding a new one.

Raised in the review of #2818: #2818 (comment)

🤖 Generated with Claude Code

https://claude.ai/code/session_01UBBvKZkzbfEPKctwTN8SDf

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions