{"action":"created","issue":{"url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/4","labels_url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/4/comments","events_url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/4/events","html_url":"https://github.com/blocks4j/commons-metrics3/pull/4","id":117213704,"number":4,"title":"Suports minutely, daily, hourly and monthly granularities.","user":{"login":"andrericos","id":4613478,"avatar_url":"https://avatars.githubusercontent.com/u/4613478?v=3","gravatar_id":"","url":"https://api.github.com/users/andrericos","html_url":"https://github.com/andrericos","followers_url":"https://api.github.com/users/andrericos/followers","following_url":"https://api.github.com/users/andrericos/following{/other_user}","gists_url":"https://api.github.com/users/andrericos/gists{/gist_id}","starred_url":"https://api.github.com/users/andrericos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrericos/subscriptions","organizations_url":"https://api.github.com/users/andrericos/orgs","repos_url":"https://api.github.com/users/andrericos/repos","events_url":"https://api.github.com/users/andrericos/events{/privacy}","received_events_url":"https://api.github.com/users/andrericos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-16T20:45:37Z","updated_at":"2015-11-16T23:03:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/blocks4j/commons-metrics3/pulls/4","html_url":"https://github.com/blocks4j/commons-metrics3/pull/4","diff_url":"https://github.com/blocks4j/commons-metrics3/pull/4.diff","patch_url":"https://github.com/blocks4j/commons-metrics3/pull/4.patch"},"body":"Example of using:\r\nMetricRepository metricRepository = MetricRepository.forRegistry(new MetricRegistry())\r\n                                        .build();\r\n\r\n\r\n        DailyMetricId<Counter> errorCounterId = DailyMetricId.createDailyCounterIdBuilder().name(\"ErrorCounter\")\r\n                                                                                         .ownerClass(Object.class)\r\n                                                            .build();\r\n\r\n        DailyMetricId<Counter> successCounterId = DailyMetricId.createDailyCounterIdBuilder().name(\"SuccessCounter\")\r\n                                                                                           .ownerClass(Object.class)\r\n                                                            .build();\r\n\r\n        DailyMetricId<Timer> operationTimerId = DailyMetricId.createDailyTimerIdBuilder().name(\"SuccessCounter\")\r\n                                                                                             .ownerClass(Object.class)\r\n                                                               .build();\r\n        \r\n        while(shoudExecute()){\r\n            Timer.Context time = metricRepository.getMetric(operationTimerId).time();\r\n            try{\r\n                operation();\r\n                metricRepository.getMetric(errorCounterId).inc();        \r\n            } catch (Exception e){\r\n                metricRepository.getMetric(successCounterId).inc();\r\n                throw e;\r\n            } finally {\r\n                time.stop();\r\n            }\r\n        }\r\n\r\nWhat do you think of that?\r\n\r\nregards,"},"comment":{"url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/comments/157202854","html_url":"https://github.com/blocks4j/commons-metrics3/pull/4#issuecomment-157202854","issue_url":"https://api.github.com/repos/blocks4j/commons-metrics3/issues/4","id":157202854,"user":{"login":"dmutti","id":660484,"avatar_url":"https://avatars.githubusercontent.com/u/660484?v=3","gravatar_id":"","url":"https://api.github.com/users/dmutti","html_url":"https://github.com/dmutti","followers_url":"https://api.github.com/users/dmutti/followers","following_url":"https://api.github.com/users/dmutti/following{/other_user}","gists_url":"https://api.github.com/users/dmutti/gists{/gist_id}","starred_url":"https://api.github.com/users/dmutti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmutti/subscriptions","organizations_url":"https://api.github.com/users/dmutti/orgs","repos_url":"https://api.github.com/users/dmutti/repos","events_url":"https://api.github.com/users/dmutti/events{/privacy}","received_events_url":"https://api.github.com/users/dmutti/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T23:03:54Z","updated_at":"2015-11-16T23:03:54Z","body":"@andrericos \r\nQuase lá. Só troca os \"31*\" do hashCode por HashCodeUtils do commons-lang. Muito mais prático.\r\n\r\n[ ]s\r\nDanilo Mutti"}}