From 339ad7a455904432e90665ba519bdc18a73447f8 Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Tue, 3 Dec 2024 10:50:14 -0800 Subject: [PATCH] add comment --- snuba/web/rpc/v1/endpoint_time_series.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snuba/web/rpc/v1/endpoint_time_series.py b/snuba/web/rpc/v1/endpoint_time_series.py index 3bc9fa7e4c..f9e220d13c 100644 --- a/snuba/web/rpc/v1/endpoint_time_series.py +++ b/snuba/web/rpc/v1/endpoint_time_series.py @@ -234,6 +234,14 @@ def _build_query(request: TimeSeriesRequest) -> Query: res = Query( from_clause=entity, selected_columns=[ + # buckets time by granularity according to the start time of the request. + # time_slot = start_time + (((timestamp - start_time) // granularity) * granularity) + # Example: + # start_time = 1001 + # end_time = 1901 + # granularity = 300 + # timestamps = [1201, 1002, 1302, 1400, 1700] + # buckets = [1001, 1301, 1601] # end time not included because it would be filtered out by the request SelectedExpression( name="time", expression=f.toDateTime(