{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/servo/issues/389","repository_url":"https://api.github.com/repos/Netflix/servo","labels_url":"https://api.github.com/repos/Netflix/servo/issues/389/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/servo/issues/389/comments","events_url":"https://api.github.com/repos/Netflix/servo/issues/389/events","html_url":"https://github.com/Netflix/servo/issues/389","id":163135950,"number":389,"title":"Min/max metric values are zero even though totalTime and count are non-zero","user":{"login":"hiteshdholaria","id":3814738,"avatar_url":"https://avatars.githubusercontent.com/u/3814738?v=3","gravatar_id":"","url":"https://api.github.com/users/hiteshdholaria","html_url":"https://github.com/hiteshdholaria","followers_url":"https://api.github.com/users/hiteshdholaria/followers","following_url":"https://api.github.com/users/hiteshdholaria/following{/other_user}","gists_url":"https://api.github.com/users/hiteshdholaria/gists{/gist_id}","starred_url":"https://api.github.com/users/hiteshdholaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiteshdholaria/subscriptions","organizations_url":"https://api.github.com/users/hiteshdholaria/orgs","repos_url":"https://api.github.com/users/hiteshdholaria/repos","events_url":"https://api.github.com/users/hiteshdholaria/events{/privacy}","received_events_url":"https://api.github.com/users/hiteshdholaria/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Netflix/servo/labels/Question","name":"Question","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-30T10:46:54Z","updated_at":"2016-07-01T12:30:16Z","closed_at":null,"body":"We have been facing an issue in which we are not getting the correct values for min/max gauge values. Even though, totalTime and count metrics are non-zero, we get zero values for min/max metrics. This behavior is arbitrary and not regular, hence some of the times it gives the correct values for min/max, but for most of the times, it gives zero values.\r\n\r\nWe are using a custom BasicTimer (e.g., DenormalizedBasicTimer which extends AbstractMonitor<Long> and implements Timer, CompositeMonitor<Long>) and have registered MonitorRegistryMetricPoller as a poller polling every 30 seconds.\r\n\r\nJava: 1.7.0_02\r\nNetflix Servo: 0.9.2\r\nOS: Windows Server 2008 (64-bit)"},"comment":{"url":"https://api.github.com/repos/Netflix/servo/issues/comments/229934685","html_url":"https://github.com/Netflix/servo/issues/389#issuecomment-229934685","issue_url":"https://api.github.com/repos/Netflix/servo/issues/389","id":229934685,"user":{"login":"brharrington","id":1289028,"avatar_url":"https://avatars.githubusercontent.com/u/1289028?v=3","gravatar_id":"","url":"https://api.github.com/users/brharrington","html_url":"https://github.com/brharrington","followers_url":"https://api.github.com/users/brharrington/followers","following_url":"https://api.github.com/users/brharrington/following{/other_user}","gists_url":"https://api.github.com/users/brharrington/gists{/gist_id}","starred_url":"https://api.github.com/users/brharrington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brharrington/subscriptions","organizations_url":"https://api.github.com/users/brharrington/orgs","repos_url":"https://api.github.com/users/brharrington/repos","events_url":"https://api.github.com/users/brharrington/events{/privacy}","received_events_url":"https://api.github.com/users/brharrington/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T12:30:16Z","updated_at":"2016-07-01T12:30:16Z","body":"For the original question about 0 values for min/max, I think @dmuino is correct that the most likely candidate is the `servo.pollers` setting. If you set a system property with `-Dservo.pollers=30000` do you still see problems?\r\n\r\n> If we use BasicCounter instead of our own DeltaCounter, it gives the complete list of metrics (as expected), however those metrics seems to be coming in different scales\r\n\r\nIn both cases the value for the counter is a rate, the difference is just what time period is used for the denominator. The default always reports as a rate per second. In your DeltaCounter it would be a rate per reporting interval. We prefer a rate per second because it is easier to compare samples collected with different intervals and is the more common value users think about for common counters. For example, a user wants to know the requests/second hitting their service over time.\r\n\r\n> Count should have been 1 rather than 1/60. Moreover, other metrics seems to be normalized differently!\r\n\r\nThe counters are rates where as the min/max values are sampled values. So for your example (assuming unit of milliseconds which is default for servo):\r\n\r\n* `totalTime` -- 75.3420035666667 milliseconds/second\r\n* `count` -- 0.0166666666666667 events/second\r\n* `min` -- 4520.520214 milliseconds\r\n* `max` -- 4520.520214 milliseconds\r\n* `avg` -- `totalTime` / `count` = 4520.520214 milliseconds/event. We don't report a local average because it leads to average of averages problem. Rather we compute the average for presentation using `totalTime/count`. This would have a unit of `(milliseconds/second) / (events/second) = milliseconds/event`."}}
{"actor":{"display_login":"brharrington"}}