Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
The following API queries raw influx data causing it to be slow and thus it times out:
GET api/1.2/cache_stats
That API endpoint currently runs 2 queries like such:
series query:
SELECT sum(value)*1000/6 FROM "metricName" WHERE time > '2017-05-03T09:22:00-06:00' AND time < '2017-05-04T09:22:00-06:00' AND cdn = 'cdn1' GROUP BY time(60s), cdn ORDER BY asc
summary query:
SELECT mean(value), percentile(value, 5), percentile(value, 95), percentile(value, 98), min(value), max(value), sum(value), count(value) FROM "metricName" WHERE cdn = 'cdn1' AND time > '2017-05-03T09:22:00-06:00' AND time < '2017-05-04T09:22:00-06:00' GROUP BY time(60s), cdn
Those queries should leverage the summarized data and look like this instead:
series query:
SELECT sum(value)/count(value) FROM "monthly"."metricName.cdn.1min" WHERE cdn = 'cdn1' AND time > '2017-05-03T09:22:00-06:00' AND time < '2017-05-04T09:22:00-06:00' GROUP BY time(60s), cdn ORDER BY asc
summary query:
SELECT mean(value), percentile(value, 5), percentile(value, 95), percentile(value, 98), min(value), max(value), sum(value), count(value) FROM "monthly"."metricName.cdn.1min" WHERE cdn = 'cdn1' AND time > '2017-05-03T09:22:00-06:00' AND time < '2017-05-04T09:22:00-06:00' GROUP BY time(60s), cdn
Attachments
Issue Links
- links to