{"action":"closed","issue":{"url":"https://api.github.com/repos/outbrain/prometheus-client/issues/16","repository_url":"https://api.github.com/repos/outbrain/prometheus-client","labels_url":"https://api.github.com/repos/outbrain/prometheus-client/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/outbrain/prometheus-client/issues/16/comments","events_url":"https://api.github.com/repos/outbrain/prometheus-client/issues/16/events","html_url":"https://github.com/outbrain/prometheus-client/issues/16","id":313992569,"number":16,"title":"Bug in com.outbrain.swinfra.metrics.Summary _sum metric","user":{"login":"ahadadi","id":25010233,"avatar_url":"https://avatars1.githubusercontent.com/u/25010233?v=4","gravatar_id":"","url":"https://api.github.com/users/ahadadi","html_url":"https://github.com/ahadadi","followers_url":"https://api.github.com/users/ahadadi/followers","following_url":"https://api.github.com/users/ahadadi/following{/other_user}","gists_url":"https://api.github.com/users/ahadadi/gists{/gist_id}","starred_url":"https://api.github.com/users/ahadadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahadadi/subscriptions","organizations_url":"https://api.github.com/users/ahadadi/orgs","repos_url":"https://api.github.com/users/ahadadi/repos","events_url":"https://api.github.com/users/ahadadi/events{/privacy}","received_events_url":"https://api.github.com/users/ahadadi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-13T07:11:15Z","updated_at":"2018-05-02T07:29:35Z","closed_at":"2018-05-02T07:29:35Z","author_association":"CONTRIBUTOR","body":"There is a bug in com.outbrain.swinfra.metrics.Summary (metricFactory.newSummary) which makes the _sum metric return nonsensical values.\r\n \r\nSummary's documentation says:\r\n\r\nSum - the sum of all its measurements.\r\nThe name of this metric will consist of the original metric name with a '_sum' suffix\r\nCount - the number of measurements taken.\r\nThe name of this metric will consist of the original metric name with a '_count' suffix\r\nSo I would expect _sum to be implemented as a counter that is incremented by the observed value (which is not the case), and _count to be implemented as a counter that is incremented by 1 for each observation (which is indeed the case).If you look at com/outbrain/swinfra/metrics/Summary.java:229, you'll see that _sum is calculated from com.codahale.metrics.Histogram::getSnapshot.\r\nThis snapshot is a sample of 1028 values observed by ExponentiallyDecayingReservoir, so what you actually get is a point in time sum of these 1028 samples."}}
{"actor":{"display_login":"ahadadi"}}