{"action":"created","comment":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/comments/204477490","pull_request_review_id":139535359,"id":204477490,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDQ3NzQ5MA==","diff_hunk":"@@ -0,0 +1,83 @@\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.runtime.core.internal.context.thread.notification;\n+\n+import org.apache.commons.math3.stat.StatUtils;\n+import org.mule.runtime.api.util.Pair;\n+\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+import static java.lang.Math.sqrt;\n+\n+public class ThreadsStatistics {\n+\n+  private Map<Pair<String, String>, List<Long>> times = new HashMap<>();\n+\n+  public synchronized void addThreadNotificationElement(ThreadNotificationService.ThreadNotificationElement notification) {\n+    Pair<String, String> key = new Pair<>(notification.getFromThreadType(), notification.getToThreadType());\n+    if (!times.containsKey(key)) {\n+      times.put(key, new ArrayList<>());\n+    }\n+    times.get(key).add(notification.getTransitionTime());\n+  }\n+\n+  public synchronized void addThreadNotificationElements(List<ThreadNotificationService.ThreadNotificationElement> notifications) {\n+    notifications.stream().forEach(notification -> addThreadNotificationElement(notification));\n+  }\n+\n+  public Set<Pair<String, String>> getPossibleTransitions() {\n+    return times.keySet();\n+  }\n+\n+  private double[] longToDoubleArray(Long[] org) {","path":"core/src/main/java/org/mule/runtime/core/internal/context/thread/notification/ThreadsStatistics.java","position":40,"original_position":40,"commit_id":"cb4b8e500ba217197c5b89a8b0b0c1671823c984","original_commit_id":"cb4b8e500ba217197c5b89a8b0b0c1671823c984","user":{"login":"elrodro83","id":8010105,"node_id":"MDQ6VXNlcjgwMTAxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/8010105?v=4","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":"why?","created_at":"2018-07-23T16:49:15Z","updated_at":"2018-07-23T16:54:46Z","html_url":"https://github.com/mulesoft/mule/pull/7054#discussion_r204477490","pull_request_url":"https://api.github.com/repos/mulesoft/mule/pulls/7054","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments/204477490"},"html":{"href":"https://github.com/mulesoft/mule/pull/7054#discussion_r204477490"},"pull_request":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/7054"}}},"pull_request":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/7054","id":203241617,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMjQxNjE3","html_url":"https://github.com/mulesoft/mule/pull/7054","diff_url":"https://github.com/mulesoft/mule/pull/7054.diff","patch_url":"https://github.com/mulesoft/mule/pull/7054.patch","issue_url":"https://api.github.com/repos/mulesoft/mule/issues/7054","number":7054,"state":"open","locked":false,"title":"MULE-15267: Provide ways to measure the latency introduced by the thread switches","user":{"login":"mbuchwald","id":7670018,"node_id":"MDQ6VXNlcjc2NzAwMTg=","avatar_url":"https://avatars2.githubusercontent.com/u/7670018?v=4","gravatar_id":"","url":"https://api.github.com/users/mbuchwald","html_url":"https://github.com/mbuchwald","followers_url":"https://api.github.com/users/mbuchwald/followers","following_url":"https://api.github.com/users/mbuchwald/following{/other_user}","gists_url":"https://api.github.com/users/mbuchwald/gists{/gist_id}","starred_url":"https://api.github.com/users/mbuchwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbuchwald/subscriptions","organizations_url":"https://api.github.com/users/mbuchwald/orgs","repos_url":"https://api.github.com/users/mbuchwald/repos","events_url":"https://api.github.com/users/mbuchwald/events{/privacy}","received_events_url":"https://api.github.com/users/mbuchwald/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-23T14:40:52Z","updated_at":"2018-07-23T16:54:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8659cd4ec45c85fecb0dd5218defbe79602414ff","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mulesoft/mule/pulls/7054/commits","review_comments_url":"https://api.github.com/repos/mulesoft/mule/pulls/7054/comments","review_comment_url":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mulesoft/mule/issues/7054/comments","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/cb4b8e500ba217197c5b89a8b0b0c1671823c984","head":{"label":"mulesoft:MULE-15267","ref":"MULE-15267","sha":"cb4b8e500ba217197c5b89a8b0b0c1671823c984","user":{"login":"mulesoft","id":185740,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTc0MA==","avatar_url":"https://avatars1.githubusercontent.com/u/185740?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MDU4NTYy","name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTc0MA==","avatar_url":"https://avatars1.githubusercontent.com/u/185740?v=4","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}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2018-07-23T16:25:41Z","pushed_at":"2018-07-23T16:27:01Z","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":230326,"stargazers_count":621,"watchers_count":621,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":509,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":509,"open_issues":12,"watchers":621,"default_branch":"mule-4.x"}},"base":{"label":"mulesoft:mule-4.x","ref":"mule-4.x","sha":"6f2c4440a67da449172753198af1f9f4a118b421","user":{"login":"mulesoft","id":185740,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTc0MA==","avatar_url":"https://avatars1.githubusercontent.com/u/185740?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MDU4NTYy","name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTc0MA==","avatar_url":"https://avatars1.githubusercontent.com/u/185740?v=4","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}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2018-07-23T16:25:41Z","pushed_at":"2018-07-23T16:27:01Z","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":230326,"stargazers_count":621,"watchers_count":621,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":509,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":509,"open_issues":12,"watchers":621,"default_branch":"mule-4.x"}},"_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/7054"},"html":{"href":"https://github.com/mulesoft/mule/pull/7054"},"issue":{"href":"https://api.github.com/repos/mulesoft/mule/issues/7054"},"comments":{"href":"https://api.github.com/repos/mulesoft/mule/issues/7054/comments"},"review_comments":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/7054/comments"},"review_comment":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/7054/commits"},"statuses":{"href":"https://api.github.com/repos/mulesoft/mule/statuses/cb4b8e500ba217197c5b89a8b0b0c1671823c984"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"elrodro83"}}