Uploaded image for project: 'Traffic Control'
  1. Traffic Control
  2. TC-270

GET api/cache_stats needs to query summarized influx data rather than raw data

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.0
    • Traffic Ops, Traffic Stats
    • 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

          Activity

            People

              mitchell852@apache.org Jeremy Mitchell
              mitchell852@apache.org Jeremy Mitchell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: