[ https://issues.apache.org/jira/browse/TC-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Mitchell closed TC-270. ------------------------------ > GET api/cache_stats needs to query summarized influx data rather than raw data > ------------------------------------------------------------------------------ > > Key: TC-270 > URL: https://issues.apache.org/jira/browse/TC-270 > Project: Traffic Control > Issue Type: Improvement > Components: Traffic Ops, Traffic Stats > Reporter: Jeremy Mitchell > Assignee: Jeremy Mitchell > Priority: Minor > Fix For: 2.1.0 > > > 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 -- This message was sent by Atlassian JIRA (v6.3.15#6346)