Skip to content

Commit

Permalink
store raw aggregate interval as header
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Nov 15, 2023
1 parent 351c3a7 commit 85e887f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions aggrec/aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"Content-Encoding",
"Signature",
"Signature-Input",
"Aggregate-Interval",
]

ALLOWED_AGGREGATE_TYPES = ["histogram", "vector"]
Expand Down Expand Up @@ -146,7 +147,8 @@ def get_new_aggregate_event_message(
).strftime("%Y-%m-%dT%H:%M:%SZ"),
"interval_duration": metadata.aggregate_interval_duration,
}
if metadata.aggregate_interval
if metadata.aggregate_interval_start
and metadata.aggregate_interval_duration
else {}
),
}
Expand Down Expand Up @@ -212,7 +214,6 @@ async def create_aggregate(
metadata = AggregateMetadata(
id=aggregate_id,
aggregate_type=aggregate_type,
aggregate_interval=aggregate_interval,
aggregate_interval_start=aggregate_interval_start,
aggregate_interval_duration=aggregate_interval_duration,
creator=creator,
Expand Down
1 change: 0 additions & 1 deletion aggrec/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ class AggregateMetadata(Document):
s3_bucket = StringField()
s3_object_key = StringField()

aggregate_interval = StringField()
aggregate_interval_start = DateTimeField()
aggregate_interval_duration = IntField()

0 comments on commit 85e887f

Please sign in to comment.