MCPcopy
hub / github.com/redis/redis-py / test_range_bucket_timestamp

Function test_range_bucket_timestamp

tests/test_timeseries.py:330–359  ·  view source on GitHub ↗
(client: redis.Redis)

Source from the content-addressed store, hash-verified

328@pytest.mark.redismod
329@skip_ifmodversion_lt("1.8.0", "timeseries")
330def test_range_bucket_timestamp(client: redis.Redis):
331 timeseries = client.ts()
332 timeseries.create("t1")
333 timeseries.add("t1", 15, 1)
334 timeseries.add("t1", 17, 4)
335 timeseries.add("t1", 51, 3)
336 timeseries.add("t1", 73, 5)
337 timeseries.add("t1", 75, 3)
338 assert_resp_response(
339 client,
340 timeseries.range(
341 "t1", 0, 100, align=0, aggregation_type="max", bucket_size_msec=10
342 ),
343 [(10, 4.0), (50, 3.0), (70, 5.0)],
344 [[10, 4.0], [50, 3.0], [70, 5.0]],
345 )
346 assert_resp_response(
347 client,
348 timeseries.range(
349 "t1",
350 0,
351 100,
352 align=0,
353 aggregation_type="max",
354 bucket_size_msec=10,
355 bucket_timestamp="+",
356 ),
357 [(20, 4.0), (60, 3.0), (80, 5.0)],
358 [[20, 4.0], [60, 3.0], [80, 5.0]],
359 )
360
361
362@pytest.mark.redismod

Callers

nothing calls this directly

Calls 5

assert_resp_responseFunction · 0.85
rangeMethod · 0.80
tsMethod · 0.45
createMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected