Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
volokluev committed Dec 3, 2024
1 parent 3dad5df commit 339ad7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions snuba/web/rpc/v1/endpoint_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 339ad7a

Please sign in to comment.