{"action":"created","issue":{"url":"https://api.github.com/repos/Comcast/traffic_control/issues/539","labels_url":"https://api.github.com/repos/Comcast/traffic_control/issues/539/labels{/name}","comments_url":"https://api.github.com/repos/Comcast/traffic_control/issues/539/comments","events_url":"https://api.github.com/repos/Comcast/traffic_control/issues/539/events","html_url":"https://github.com/Comcast/traffic_control/issues/539","id":107087683,"number":539,"title":"Influx summary query returns results not found in the corresponding series query (i.e. max and min)","user":{"login":"mitchell852","id":251272,"avatar_url":"https://avatars.githubusercontent.com/u/251272?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchell852","html_url":"https://github.com/mitchell852","followers_url":"https://api.github.com/users/mitchell852/followers","following_url":"https://api.github.com/users/mitchell852/following{/other_user}","gists_url":"https://api.github.com/users/mitchell852/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchell852/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchell852/subscriptions","organizations_url":"https://api.github.com/users/mitchell852/orgs","repos_url":"https://api.github.com/users/mitchell852/repos","events_url":"https://api.github.com/users/mitchell852/events{/privacy}","received_events_url":"https://api.github.com/users/mitchell852/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Comcast/traffic_control/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Comcast/traffic_control/labels/Traffic%20Ops","name":"Traffic Ops","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"mitchell852","id":251272,"avatar_url":"https://avatars.githubusercontent.com/u/251272?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchell852","html_url":"https://github.com/mitchell852","followers_url":"https://api.github.com/users/mitchell852/followers","following_url":"https://api.github.com/users/mitchell852/following{/other_user}","gists_url":"https://api.github.com/users/mitchell852/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchell852/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchell852/subscriptions","organizations_url":"https://api.github.com/users/mitchell852/orgs","repos_url":"https://api.github.com/users/mitchell852/repos","events_url":"https://api.github.com/users/mitchell852/events{/privacy}","received_events_url":"https://api.github.com/users/mitchell852/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Comcast/traffic_control/milestones/7","html_url":"https://github.com/Comcast/traffic_control/milestones/1.1.7","labels_url":"https://api.github.com/repos/Comcast/traffic_control/milestones/7/labels","id":1316543,"number":7,"title":"1.1.7","description":null,"creator":{"login":"mtorluemke","id":3515510,"avatar_url":"https://avatars.githubusercontent.com/u/3515510?v=3","gravatar_id":"","url":"https://api.github.com/users/mtorluemke","html_url":"https://github.com/mtorluemke","followers_url":"https://api.github.com/users/mtorluemke/followers","following_url":"https://api.github.com/users/mtorluemke/following{/other_user}","gists_url":"https://api.github.com/users/mtorluemke/gists{/gist_id}","starred_url":"https://api.github.com/users/mtorluemke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtorluemke/subscriptions","organizations_url":"https://api.github.com/users/mtorluemke/orgs","repos_url":"https://api.github.com/users/mtorluemke/repos","events_url":"https://api.github.com/users/mtorluemke/events{/privacy}","received_events_url":"https://api.github.com/users/mtorluemke/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":16,"state":"open","created_at":"2015-09-21T15:18:59Z","updated_at":"2015-10-09T18:54:49Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-09-17T22:19:26Z","updated_at":"2015-10-09T18:54:49Z","closed_at":null,"body":"For example, the influx series query results may look like this:\r\n\r\n[\r\n  [time, value],\r\n  [time, 10],\r\n  [time, 20],\r\n  [time, 34],\r\n  [time, 26]\r\n]\r\n\r\nand the influx summary query results for the same timeframe may look like:\r\n\r\n{\r\n  time: x,\r\n  mean: y,\r\n  min: 8,\r\n  max: 75\r\n}\r\n\r\nnotice how the min=8 and max=75 is strange because 8 and 75 are not found in the series query. this is because the series query is being grouped into 60s intervals (which is an average of 6 10s intervals) but the summary query looks at every value recorded in influx (on the 10s interval) between the timeframe.\r\n\r\nso in this example, i would expect min=10 and max=34\r\n\r\nmaybe it's possible to run the summary query against the series query results?? like a subselect query like this:\r\n\r\nSELECT mean(value), percentile(value, 5), percentile(value, 95), percentile(value, 98), min(value), max(value), count(value) FROM (SELECT sum(value)/count(value) FROM tps_total WHERE cachegroup = 'total' AND deliveryservice = 'ds-name' AND time >='2015-09-17T03:38:00-06:00' AND time <= '2015-09-17T15:38:00-06:00' GROUP BY time(60s), cachegroup)\r\n\r\nthis bug pertains to the following api endpoint /api/version/deliveryservice_stats.json when data source is influx.\r\n\r\nhere are a couple sample influx queries:\r\n\r\nsummary_query #-> $VAR1 = 'SELECT mean(value), percentile(value, 5), percentile(value, 95), percentile(value, 98), min(value), max(value), count(value) FROM tps_total WHERE time >= \\'2015-09-17T03:38:00-06:00\\' AND time <= \\'2015-09-17T15:38:00-06:00\\' AND cachegroup = \\'total\\' AND deliveryservice = \\'ds-name\\'';\r\n\r\nseries_query #-> $VAR1 = 'SELECT sum(value)/count(value) FROM tps_total WHERE cachegroup = \\'total\\' AND deliveryservice = \\'ds-name\\' AND time >=\\'2015-09-17T03:38:00-06:00\\' AND time <= \\'2015-09-17T15:38:00-06:00\\' GROUP BY time(60s), cachegroup';"},"comment":{"url":"https://api.github.com/repos/Comcast/traffic_control/issues/comments/146960466","html_url":"https://github.com/Comcast/traffic_control/issues/539#issuecomment-146960466","issue_url":"https://api.github.com/repos/Comcast/traffic_control/issues/539","id":146960466,"user":{"login":"mitchell852","id":251272,"avatar_url":"https://avatars.githubusercontent.com/u/251272?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchell852","html_url":"https://github.com/mitchell852","followers_url":"https://api.github.com/users/mitchell852/followers","following_url":"https://api.github.com/users/mitchell852/following{/other_user}","gists_url":"https://api.github.com/users/mitchell852/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchell852/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchell852/subscriptions","organizations_url":"https://api.github.com/users/mitchell852/orgs","repos_url":"https://api.github.com/users/mitchell852/repos","events_url":"https://api.github.com/users/mitchell852/events{/privacy}","received_events_url":"https://api.github.com/users/mitchell852/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T18:54:49Z","updated_at":"2015-10-09T18:54:49Z","body":"this is not fixed. :( if you pass in another interval like 1h, this issue again occurs. \r\n\r\nthis will require a summary query based on a series query or basically a nested query as the issue suggested and nested queries are not yet supported in influxdb - https://github.com/influxdb/influxdb/issues/52"}}