Skip to content

Commit 90a6108

Browse files
Merge pull request #143 from stefan-brus-frequenz/end_time
Update time filter docs, clarify presence/absence of fields
2 parents e3c179d + 6fff88c commit 90a6108

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Summary
44

5-
- The changes introduced in v0.9.0 have been reverted. `frequenz.api.reporting.v1` now serves the `frequenz.api.common.v1` definitions.
6-
- A new protobuf package has been introduced, `frequenz.api.reporting.v1alpha10`, in which the `frequenz.api.common.v1alpha8` adaptations can be found.
5+
- The behavior of the TimeFilter has changed, and its documentation has been updated accordingly.
76

87
## Upgrading
98

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ plugins:
112112
show_source: true
113113
show_symbol_type_toc: true
114114
signature_crossrefs: true
115+
docstring_options:
116+
warn_missing_types: false
115117
import:
116118
# See https://mkdocstrings.github.io/python/usage/#import for details
117119
- https://docs.python.org/3/objects.inv

proto/frequenz/api/reporting/v1alpha10/reporting.proto

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,30 @@ enum FilterOption {
7474
FILTER_OPTION_INCLUDE = 2;
7575
}
7676

77-
// Time-based filter for querying aggregated microgrid components data.
77+
// Time-filter defining the historical window and real-time behaviour of the stream.
7878
//
79-
// !!! note
80-
// Specifies the start and end time for the query. Both fields are optional, but
81-
// their absence or presence has specific implications for the query results.
82-
// Data will be returned as a set of rows, which each row containing a timestamp.
83-
// This timestamp will be >= start and < end.
79+
// Semantics:
80+
// - If `end_time` is provided, it MUST be ≤ the current server time. The
81+
// server streams all samples t where start_time ≤ t < end_time and
82+
// then closes the stream.
83+
//
84+
// - If `end_time` is omitted, the server streams all historical samples
85+
// t ≥ start_time (if provided) and then continues streaming new samples
86+
// in real time. The stream remains open indefinitely.
87+
//
88+
// - If `start_time` is omitted:
89+
// – and `end_time` is omitted: the stream produces no historical data
90+
// and begins streaming real-time samples only.
91+
// – and `end_time` is provided: the historical window is empty and
92+
// the stream closes immediately.
93+
//
94+
// Validation rules:
95+
// - end_time > now() → INVALID_ARGUMENT
8496
message TimeFilter {
8597
// Optional UTC start time for the query.
86-
//
87-
// !!! info
88-
// If not provided, the query defaults to the earliest available data for the
89-
// specified microgrid components.
9098
google.protobuf.Timestamp start_time = 1;
9199

92100
// Optional UTC end time for the query.
93-
//
94-
// !!! info
95-
// If not provided, the query will retrieve the requested data and continue
96-
// streaming all new data as it becomes available.
97101
google.protobuf.Timestamp end_time = 2;
98102
}
99103

0 commit comments

Comments
 (0)