Skip to content

Commit

Permalink
Improve extension points for new batch modes (*)
Browse files Browse the repository at this point in the history
Future documents may define new batch modes. We don't make this easy, as
the semantics of batch modes are currently tightly integrated into the
document. We would instead like all of the language pertaining to
*specific* to be self-contained so that it's easy to specify a batch
mode that is sound and complete.

Each batch mode specifies the following things:

* The contents of the `Query`, `BatchSelector`, and
  `PartialBatchSelector`, which are effectively extension points for
  hooking batch modes into aggregation.

* Batch buckets, including how they're identified, how reports are
  mapped to batch buckets, and the buckets specified by a query.

This commit moves the specifics of leader-selected and time-interval to
a new section. It also adds a new section with guidelines for extending
the DAP document, including by adding new batch modes.

Finally, to help reduce implementation complexity, add a length prefix
to the extension points so that collection and aggregation requests can
be decoded even if the indicated batch mode is not recognized. This is
not strictly necessary, as the current text requires abort in this case;
but it does help separate parsing logic (how do I read this message)
from protocol logic (what batch modes do I support).

Other changes:

* Simplify the "batchOverlap" condition: ""the batch buckets of the
  query MUST NOT overlap with the previously aggregated buckets.
  Accordingly remove the following redundant language:

  > For time-interval tasks, it is sufficient (but not necessary) to
  > check that the batch interval does not overlap with the batch
  > interval of any previous query. If this batch interval check fails,
  > then the Aggregator MAY abort with error of type "batchOverlap".

Co-authored-by: Brandon Pitman <[email protected]>
  • Loading branch information
cjpatton and branlwyd committed Oct 31, 2024
1 parent 665063e commit 98379a8
Showing 1 changed file with 283 additions and 191 deletions.
Loading

0 comments on commit 98379a8

Please sign in to comment.