{"action":"created","comment":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/comments/42865269","id":42865269,"diff_hunk":"@@ -0,0 +1,173 @@\n+/*\n+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com\n+ * The software in this package is published under the terms of the CPAL v1.0\n+ * license, a copy of which has been included with this distribution in the\n+ * LICENSE.txt file.\n+ */\n+package org.mule.management.stats;\n+\n+import static org.hamcrest.MatcherAssert.assertThat;\n+import static org.hamcrest.Matchers.equalTo;\n+\n+import org.junit.After;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.mule.tck.junit4.AbstractMuleTestCase;\n+\n+/**\n+ * Validates some basic assumptions about the ComponentStatistics class\n+ * behavior.\n+ */\n+public class ComponentStatisticsTestCase extends AbstractMuleTestCase {\n+\n+    /* This class was added to address MULE-6417 */\n+    \n+    private String originalStatIntervalTime;","path":"core/src/test/java/org/mule/management/stats/ComponentStatisticsTestCase.java","position":25,"original_position":25,"commit_id":"b6073be6a2096d52a31c5e24e25016a604ef0979","original_commit_id":"b6073be6a2096d52a31c5e24e25016a604ef0979","user":{"login":"elrodro83","id":8010105,"avatar_url":"https://avatars.githubusercontent.com/u/8010105?v=3","gravatar_id":"","url":"https://api.github.com/users/elrodro83","html_url":"https://github.com/elrodro83","followers_url":"https://api.github.com/users/elrodro83/followers","following_url":"https://api.github.com/users/elrodro83/following{/other_user}","gists_url":"https://api.github.com/users/elrodro83/gists{/gist_id}","starred_url":"https://api.github.com/users/elrodro83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elrodro83/subscriptions","organizations_url":"https://api.github.com/users/elrodro83/orgs","repos_url":"https://api.github.com/users/elrodro83/repos","events_url":"https://api.github.com/users/elrodro83/events{/privacy}","received_events_url":"https://api.github.com/users/elrodro83/received_events","type":"User","site_admin":false},"body":"I recently realised there's a rule for achieving this. For instance, you could do something like:\r\n\r\n```\r\n@Rule\r\npublic SystemProperty statIntervalTime = new SystemProperty(\"statIntervalTime\", null);\r\n```\r\n\r\nto replace the setUp and tearDowm methods.\r\n","created_at":"2015-10-23T13:40:21Z","updated_at":"2015-10-23T13:40:21Z","html_url":"https://github.com/mulesoft/mule/pull/2043#discussion_r42865269","pull_request_url":"https://api.github.com/repos/mulesoft/mule/pulls/2043","_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments/42865269"},"html":{"href":"https://github.com/mulesoft/mule/pull/2043#discussion_r42865269"},"pull_request":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2043"}}},"pull_request":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/2043","id":44595295,"html_url":"https://github.com/mulesoft/mule/pull/2043","diff_url":"https://github.com/mulesoft/mule/pull/2043.diff","patch_url":"https://github.com/mulesoft/mule/pull/2043.patch","issue_url":"https://api.github.com/repos/mulesoft/mule/issues/2043","number":2043,"state":"open","locked":false,"title":"MULE-6417: / by zero in ComponentStatistics","user":{"login":"andyhoffy","id":4833653,"avatar_url":"https://avatars.githubusercontent.com/u/4833653?v=3","gravatar_id":"","url":"https://api.github.com/users/andyhoffy","html_url":"https://github.com/andyhoffy","followers_url":"https://api.github.com/users/andyhoffy/followers","following_url":"https://api.github.com/users/andyhoffy/following{/other_user}","gists_url":"https://api.github.com/users/andyhoffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhoffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhoffy/subscriptions","organizations_url":"https://api.github.com/users/andyhoffy/orgs","repos_url":"https://api.github.com/users/andyhoffy/repos","events_url":"https://api.github.com/users/andyhoffy/events{/privacy}","received_events_url":"https://api.github.com/users/andyhoffy/received_events","type":"User","site_admin":false},"body":"Eliminated '/ by zero' by skipping branch data updates while executedEvent(Count) is zero.\r\nAdded synchronization around clear() - now consistent with other usage of synchronization and fix other potential bugs/race conditions.\r\nAdded ComponentStatisticsTestCase to validate existing behavior and capture functional changes.\r\nAdded javadoc to describe current behavior and known weaknesses/limitations.\r\n\r\nA better fix may be to introduce an explicit Event object that can accumulate branch events and then be committed as an atomic update. However, that would break existing APIs.","created_at":"2015-09-09T20:19:44Z","updated_at":"2015-10-23T13:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fda30bf13dca9dea153f7ff60a4133f9812f93bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mulesoft/mule/pulls/2043/commits","review_comments_url":"https://api.github.com/repos/mulesoft/mule/pulls/2043/comments","review_comment_url":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mulesoft/mule/issues/2043/comments","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/b6073be6a2096d52a31c5e24e25016a604ef0979","head":{"label":"andyhoffy:mule-3.x","ref":"mule-3.x","sha":"b6073be6a2096d52a31c5e24e25016a604ef0979","user":{"login":"andyhoffy","id":4833653,"avatar_url":"https://avatars.githubusercontent.com/u/4833653?v=3","gravatar_id":"","url":"https://api.github.com/users/andyhoffy","html_url":"https://github.com/andyhoffy","followers_url":"https://api.github.com/users/andyhoffy/followers","following_url":"https://api.github.com/users/andyhoffy/following{/other_user}","gists_url":"https://api.github.com/users/andyhoffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhoffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhoffy/subscriptions","organizations_url":"https://api.github.com/users/andyhoffy/orgs","repos_url":"https://api.github.com/users/andyhoffy/repos","events_url":"https://api.github.com/users/andyhoffy/events{/privacy}","received_events_url":"https://api.github.com/users/andyhoffy/received_events","type":"User","site_admin":false},"repo":{"id":42201358,"name":"mule","full_name":"andyhoffy/mule","owner":{"login":"andyhoffy","id":4833653,"avatar_url":"https://avatars.githubusercontent.com/u/4833653?v=3","gravatar_id":"","url":"https://api.github.com/users/andyhoffy","html_url":"https://github.com/andyhoffy","followers_url":"https://api.github.com/users/andyhoffy/followers","following_url":"https://api.github.com/users/andyhoffy/following{/other_user}","gists_url":"https://api.github.com/users/andyhoffy/gists{/gist_id}","starred_url":"https://api.github.com/users/andyhoffy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyhoffy/subscriptions","organizations_url":"https://api.github.com/users/andyhoffy/orgs","repos_url":"https://api.github.com/users/andyhoffy/repos","events_url":"https://api.github.com/users/andyhoffy/events{/privacy}","received_events_url":"https://api.github.com/users/andyhoffy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andyhoffy/mule","description":"Mule Community Edition","fork":true,"url":"https://api.github.com/repos/andyhoffy/mule","forks_url":"https://api.github.com/repos/andyhoffy/mule/forks","keys_url":"https://api.github.com/repos/andyhoffy/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andyhoffy/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andyhoffy/mule/teams","hooks_url":"https://api.github.com/repos/andyhoffy/mule/hooks","issue_events_url":"https://api.github.com/repos/andyhoffy/mule/issues/events{/number}","events_url":"https://api.github.com/repos/andyhoffy/mule/events","assignees_url":"https://api.github.com/repos/andyhoffy/mule/assignees{/user}","branches_url":"https://api.github.com/repos/andyhoffy/mule/branches{/branch}","tags_url":"https://api.github.com/repos/andyhoffy/mule/tags","blobs_url":"https://api.github.com/repos/andyhoffy/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andyhoffy/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andyhoffy/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/andyhoffy/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andyhoffy/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/andyhoffy/mule/languages","stargazers_url":"https://api.github.com/repos/andyhoffy/mule/stargazers","contributors_url":"https://api.github.com/repos/andyhoffy/mule/contributors","subscribers_url":"https://api.github.com/repos/andyhoffy/mule/subscribers","subscription_url":"https://api.github.com/repos/andyhoffy/mule/subscription","commits_url":"https://api.github.com/repos/andyhoffy/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/andyhoffy/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/andyhoffy/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/andyhoffy/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/andyhoffy/mule/contents/{+path}","compare_url":"https://api.github.com/repos/andyhoffy/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andyhoffy/mule/merges","archive_url":"https://api.github.com/repos/andyhoffy/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andyhoffy/mule/downloads","issues_url":"https://api.github.com/repos/andyhoffy/mule/issues{/number}","pulls_url":"https://api.github.com/repos/andyhoffy/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/andyhoffy/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/andyhoffy/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andyhoffy/mule/labels{/name}","releases_url":"https://api.github.com/repos/andyhoffy/mule/releases{/id}","created_at":"2015-09-09T19:57:29Z","updated_at":"2015-09-09T19:57:51Z","pushed_at":"2015-10-16T14:24:36Z","git_url":"git://github.com/andyhoffy/mule.git","ssh_url":"git@github.com:andyhoffy/mule.git","clone_url":"https://github.com/andyhoffy/mule.git","svn_url":"https://github.com/andyhoffy/mule","homepage":null,"size":169685,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"mule-3.x"}},"base":{"label":"mulesoft:mule-3.x","ref":"mule-3.x","sha":"844e491a0be09a38d0429bf19767c7d6a4b06e57","user":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"repo":{"id":7058562,"name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mulesoft/mule","description":"Mule Community Edition","fork":false,"url":"https://api.github.com/repos/mulesoft/mule","forks_url":"https://api.github.com/repos/mulesoft/mule/forks","keys_url":"https://api.github.com/repos/mulesoft/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulesoft/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulesoft/mule/teams","hooks_url":"https://api.github.com/repos/mulesoft/mule/hooks","issue_events_url":"https://api.github.com/repos/mulesoft/mule/issues/events{/number}","events_url":"https://api.github.com/repos/mulesoft/mule/events","assignees_url":"https://api.github.com/repos/mulesoft/mule/assignees{/user}","branches_url":"https://api.github.com/repos/mulesoft/mule/branches{/branch}","tags_url":"https://api.github.com/repos/mulesoft/mule/tags","blobs_url":"https://api.github.com/repos/mulesoft/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulesoft/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulesoft/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulesoft/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/mulesoft/mule/languages","stargazers_url":"https://api.github.com/repos/mulesoft/mule/stargazers","contributors_url":"https://api.github.com/repos/mulesoft/mule/contributors","subscribers_url":"https://api.github.com/repos/mulesoft/mule/subscribers","subscription_url":"https://api.github.com/repos/mulesoft/mule/subscription","commits_url":"https://api.github.com/repos/mulesoft/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulesoft/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulesoft/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulesoft/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulesoft/mule/contents/{+path}","compare_url":"https://api.github.com/repos/mulesoft/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulesoft/mule/merges","archive_url":"https://api.github.com/repos/mulesoft/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulesoft/mule/downloads","issues_url":"https://api.github.com/repos/mulesoft/mule/issues{/number}","pulls_url":"https://api.github.com/repos/mulesoft/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/mulesoft/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/mulesoft/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulesoft/mule/labels{/name}","releases_url":"https://api.github.com/repos/mulesoft/mule/releases{/id}","created_at":"2012-12-07T19:23:06Z","updated_at":"2015-10-14T20:18:23Z","pushed_at":"2015-10-23T13:23:58Z","git_url":"git://github.com/mulesoft/mule.git","ssh_url":"git@github.com:mulesoft/mule.git","clone_url":"https://github.com/mulesoft/mule.git","svn_url":"https://github.com/mulesoft/mule","homepage":null,"size":487858,"stargazers_count":244,"watchers_count":244,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":293,"mirror_url":null,"open_issues_count":19,"forks":293,"open_issues":19,"watchers":244,"default_branch":"mule-3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2043"},"html":{"href":"https://github.com/mulesoft/mule/pull/2043"},"issue":{"href":"https://api.github.com/repos/mulesoft/mule/issues/2043"},"comments":{"href":"https://api.github.com/repos/mulesoft/mule/issues/2043/comments"},"review_comments":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2043/comments"},"review_comment":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2043/commits"},"statuses":{"href":"https://api.github.com/repos/mulesoft/mule/statuses/b6073be6a2096d52a31c5e24e25016a604ef0979"}}}}