Hi,
In my system I had a latency issue between my the web-server and the redis redis. This led me to discover some inefficiency in the metrics logic when updating metrics.
For each key a separate incrementation is performed which leads to multiple redis calls.
Better to use a pipe here and update all keys in a single api call.
Hi @odedfos, this seems like a great idea. Do you mind making the change, and sending me a pull request, so I can merge? Be sure to add yourself to AUTHORS.rst as well.
Hi, In my system I had a latency issue between my the web-server and the redis redis. This led me to discover some inefficiency in the metrics logic when updating metrics.
checkout def metric(self, slug, num=1, category=None, expire=None)
in https://github.com/bradmontgomery/django-redis-metrics/blob/master/redis_metrics/models.py [331]
For each key a separate incrementation is performed which leads to multiple redis calls. Better to use a pipe here and update all keys in a single api call.
for example:
Cheers!