openreplay/api/chalicelib/utils/metrics_helper.py
KRAIEM Taha Yassine 282cb4642c API
2021-05-05 19:47:36 +02:00

5 lines
245 B
Python

def __get_step_size(startTimestamp, endTimestamp, density, decimal=False, factor=1000):
step_size = (endTimestamp // factor - startTimestamp // factor)
if decimal:
return step_size / density
return step_size // (density - 1)