{"action":"opened","issue":{"url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/80","repository_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana","labels_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/80/comments","events_url":"https://api.github.com/repos/Vertamedia/clickhouse-grafana/issues/80/events","html_url":"https://github.com/Vertamedia/clickhouse-grafana/issues/80","id":362959043,"node_id":"MDU6SXNzdWUzNjI5NTkwNDM=","number":80,"title":"Add macro similar to $rateColumns for counter like metrics","user":{"login":"JiriHorky","id":427968,"node_id":"MDQ6VXNlcjQyNzk2OA==","avatar_url":"https://avatars1.githubusercontent.com/u/427968?v=4","gravatar_id":"","url":"https://api.github.com/users/JiriHorky","html_url":"https://github.com/JiriHorky","followers_url":"https://api.github.com/users/JiriHorky/followers","following_url":"https://api.github.com/users/JiriHorky/following{/other_user}","gists_url":"https://api.github.com/users/JiriHorky/gists{/gist_id}","starred_url":"https://api.github.com/users/JiriHorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JiriHorky/subscriptions","organizations_url":"https://api.github.com/users/JiriHorky/orgs","repos_url":"https://api.github.com/users/JiriHorky/repos","events_url":"https://api.github.com/users/JiriHorky/events{/privacy}","received_events_url":"https://api.github.com/users/JiriHorky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-23T17:04:08Z","updated_at":"2018-09-23T17:04:08Z","closed_at":null,"author_association":"NONE","body":"Similarly to request in #78, please consider adding support for computing $perSecond for multiple series (hosts).\r\n\r\nCurrently, the $rateColumns computes something like:\r\n```\r\nSELECT t, arrayMap(a -> (a.1, a.2/runningDifference( t/1000 )), groupArr)\r\nFROM (\r\n    SELECT t, groupArray((host, v)) as groupArr \r\n....\r\n```\r\n\r\nWhich does not produce correct results for metrics which only grows over time, as one needs to compute difference between two consequitive values `v` as well (not just time).\r\n\r\nUnfortunatelly, doing ``runningDifference(a.2)/runningDifference(t/1000)`` does not work, as `a.2` gets materialized to different values `v` between different columns (`host`).\r\n\r\nI have been scratching my head for a while and I am not sure how to write such query in Clickhouse at all. I hope you know better :)\r\n\r\n"}}
{"actor":{"display_login":"JiriHorky"}}