user3599803
user3599803

Reputation: 7014

Redis timeseries - sum all hits

I use this python client:
https://github.com/ryananguiano/python-redis-timeseries

How can I sum all hits?

ts = TimeSeries(client)

If I understand, when I query get_total_hits(), I have to pick one of:

ts.granularities
OrderedDict([('1minute', {'duration': 60, 'ttl': 3600}), ('5minute', {'duration': 300, 'ttl': 21600}), ('10minute', {'duration': 600, 'ttl': 43200}), ('1hour', {'duration': 3600, 'ttl': 604800}), ('1day', {'duration': 86400, 'ttl': 2678400})])

e.g

ts.get_total_hits('metric', '1minute', 2)

Can I write something like 'all' instead of '1minute'?
I want to sum all the hits.

I could set '1day' and a very large number, but I hope there's a better way.

Second, what is the performance of such query?

Upvotes: 1

Views: 273

Answers (1)

Ariel
Ariel

Reputation: 577

Looks like your options for this client are:

1minute, 5minute, 10minute, 1hour, 1day

Upvotes: 1

Related Questions