{"action":"created","issue":{"url":"https://api.github.com/repos/CachetHQ/Cachet/issues/2697","repository_url":"https://api.github.com/repos/CachetHQ/Cachet","labels_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/2697/labels{/name}","comments_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/2697/comments","events_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/2697/events","html_url":"https://github.com/CachetHQ/Cachet/issues/2697","id":253683584,"node_id":"MDU6SXNzdWUyNTM2ODM1ODQ=","number":2697,"title":"Sort metric points by \"created_at\" instead of \"id\"","user":{"login":"vitorbaptista","id":76945,"node_id":"MDQ6VXNlcjc2OTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/76945?v=4","gravatar_id":"","url":"https://api.github.com/users/vitorbaptista","html_url":"https://github.com/vitorbaptista","followers_url":"https://api.github.com/users/vitorbaptista/followers","following_url":"https://api.github.com/users/vitorbaptista/following{/other_user}","gists_url":"https://api.github.com/users/vitorbaptista/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorbaptista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorbaptista/subscriptions","organizations_url":"https://api.github.com/users/vitorbaptista/orgs","repos_url":"https://api.github.com/users/vitorbaptista/repos","events_url":"https://api.github.com/users/vitorbaptista/events{/privacy}","received_events_url":"https://api.github.com/users/vitorbaptista/received_events","type":"User","site_admin":false},"labels":[{"id":717138494,"node_id":"MDU6TGFiZWw3MTcxMzg0OTQ=","url":"https://api.github.com/repos/CachetHQ/Cachet/labels/Good%20First%20Issue","name":"Good First Issue","color":"90edd1","default":false},{"id":649088419,"node_id":"MDU6TGFiZWw2NDkwODg0MTk=","url":"https://api.github.com/repos/CachetHQ/Cachet/labels/Metrics","name":"Metrics","color":"fffabc","default":false},{"id":511552494,"node_id":"MDU6TGFiZWw1MTE1NTI0OTQ=","url":"https://api.github.com/repos/CachetHQ/Cachet/labels/Optimization","name":"Optimization","color":"5EBEFF","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/CachetHQ/Cachet/milestones/25","html_url":"https://github.com/CachetHQ/Cachet/milestone/25","labels_url":"https://api.github.com/repos/CachetHQ/Cachet/milestones/25/labels","id":1821037,"node_id":"MDk6TWlsZXN0b25lMTgyMTAzNw==","number":25,"title":"V2.4.0","description":"","creator":{"login":"GrahamCampbell","id":2829600,"node_id":"MDQ6VXNlcjI4Mjk2MDA=","avatar_url":"https://avatars1.githubusercontent.com/u/2829600?v=4","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"open_issues":56,"closed_issues":361,"state":"open","created_at":"2016-06-10T23:06:42Z","updated_at":"2018-07-02T21:15:54Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2017-08-29T14:30:36Z","updated_at":"2018-07-02T21:15:54Z","closed_at":"2018-07-02T21:15:54Z","author_association":"CONTRIBUTOR","body":"When querying the metric points via the `/api/v1/metrics/METRIC_ID/points` endpoint, they are returned sorted by their `id`. This creates a couple issues:\r\n\r\n* Later metric points appear in the last pages of the response\r\n* To find the latest (or first) metric point, one needs to go through each page checking their `created_at` dates\r\n\r\nAs the metric points are a time series, it makes more sense to sort them by `created_at` instead, ideally in reverse order so the latest points appear in the first pages.\r\n\r\nIf you agree, I'm happy to send a PR to change this behaviour."},"comment":{"url":"https://api.github.com/repos/CachetHQ/Cachet/issues/comments/401938854","html_url":"https://github.com/CachetHQ/Cachet/issues/2697#issuecomment-401938854","issue_url":"https://api.github.com/repos/CachetHQ/Cachet/issues/2697","id":401938854,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTkzODg1NA==","user":{"login":"jbrooksuk","id":246103,"node_id":"MDQ6VXNlcjI0NjEwMw==","avatar_url":"https://avatars1.githubusercontent.com/u/246103?v=4","gravatar_id":"","url":"https://api.github.com/users/jbrooksuk","html_url":"https://github.com/jbrooksuk","followers_url":"https://api.github.com/users/jbrooksuk/followers","following_url":"https://api.github.com/users/jbrooksuk/following{/other_user}","gists_url":"https://api.github.com/users/jbrooksuk/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrooksuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrooksuk/subscriptions","organizations_url":"https://api.github.com/users/jbrooksuk/orgs","repos_url":"https://api.github.com/users/jbrooksuk/repos","events_url":"https://api.github.com/users/jbrooksuk/events{/privacy}","received_events_url":"https://api.github.com/users/jbrooksuk/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T21:15:54Z","updated_at":"2018-07-02T21:15:54Z","author_association":"MEMBER","body":"Closed by f98ae4d3"}}
{"actor":{"display_login":"jbrooksuk"}}