{"action":"created","issue":{"url":"https://api.github.com/repos/google/mtail/issues/9","labels_url":"https://api.github.com/repos/google/mtail/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/google/mtail/issues/9/comments","events_url":"https://api.github.com/repos/google/mtail/issues/9/events","html_url":"https://github.com/google/mtail/issues/9","id":98003323,"number":9,"title":"support for division in the vm","user":{"login":"davidreuss","id":6885,"avatar_url":"https://avatars.githubusercontent.com/u/6885?v=3","gravatar_id":"","url":"https://api.github.com/users/davidreuss","html_url":"https://github.com/davidreuss","followers_url":"https://api.github.com/users/davidreuss/followers","following_url":"https://api.github.com/users/davidreuss/following{/other_user}","gists_url":"https://api.github.com/users/davidreuss/gists{/gist_id}","starred_url":"https://api.github.com/users/davidreuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidreuss/subscriptions","organizations_url":"https://api.github.com/users/davidreuss/orgs","repos_url":"https://api.github.com/users/davidreuss/repos","events_url":"https://api.github.com/users/davidreuss/events{/privacy}","received_events_url":"https://api.github.com/users/davidreuss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-29T18:45:42Z","updated_at":"2015-08-02T07:19:08Z","closed_at":null,"body":"It would be useful if you could do divisions (and multiplication if that's missing too), so you can perform simple calculations yourself. As an example, keeping an average, with something like below\r\n\r\n```\r\ncounter requests_total by vhost\r\ngauge total_request_time by vhost\r\ngauge avg_request_time by vhost\r\n\r\n/(?P<vhost>\\S+) (?P<latency>\\d+)/ {\r\n  requests_total[$vhost]++\r\n  total_request_time[$vhost] += $latency\r\n  avg_request_time[$vhost] = $total_request_time[$vhost] / $requests_total[$vhost]\r\n}\r\n```\r\n\r\nInput would look like:\r\n\r\n```\r\nexample.com 1231\r\nfoobar.com 123\r\n```\r\n\r\nAnd so on.\r\n\r\nNot sure if it's intended to be able to do these calculations yourself in mtail itself, or it's best left up to exporters to calculate these types of metrics."},"comment":{"url":"https://api.github.com/repos/google/mtail/issues/comments/126996053","html_url":"https://github.com/google/mtail/issues/9#issuecomment-126996053","issue_url":"https://api.github.com/repos/google/mtail/issues/9","id":126996053,"user":{"login":"jaqx0r","id":3038203,"avatar_url":"https://avatars.githubusercontent.com/u/3038203?v=3","gravatar_id":"","url":"https://api.github.com/users/jaqx0r","html_url":"https://github.com/jaqx0r","followers_url":"https://api.github.com/users/jaqx0r/followers","following_url":"https://api.github.com/users/jaqx0r/following{/other_user}","gists_url":"https://api.github.com/users/jaqx0r/gists{/gist_id}","starred_url":"https://api.github.com/users/jaqx0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaqx0r/subscriptions","organizations_url":"https://api.github.com/users/jaqx0r/orgs","repos_url":"https://api.github.com/users/jaqx0r/repos","events_url":"https://api.github.com/users/jaqx0r/events{/privacy}","received_events_url":"https://api.github.com/users/jaqx0r/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T07:19:08Z","updated_at":"2015-08-02T07:19:08Z","body":"One complication is that currently the VM deals entirely in ints, not floats, so the div will be an integer division in the first implementation."}}