{"action":"created","comment":{"url":"https://api.github.com/repos/statful/statful-client-java/pulls/comments/87776602","pull_request_review_id":8374177,"id":87776602,"diff_hunk":"@@ -316,4 +323,38 @@ private String buildAggregatedUri(final Aggregation aggregation, final Aggregati\n \n         return buffersAsList;\n     }\n+\n+    private void scheduleTask(final Runnable runnable) {\n+        boolean wasScheduled = false;\n+        if (executorService.getQueue().size() < configuration.getMaxWorkerTasksQueueSize()) {","path":"core/src/main/java/com/statful/client/core/sender/BufferedMetricsSender.java","position":114,"original_position":114,"commit_id":"1d2a2062a7cc4300b47e28723eab06ccf2308192","original_commit_id":"1d2a2062a7cc4300b47e28723eab06ccf2308192","user":{"login":"brunopalos","id":3313946,"avatar_url":"https://avatars.githubusercontent.com/u/3313946?v=3","gravatar_id":"","url":"https://api.github.com/users/brunopalos","html_url":"https://github.com/brunopalos","followers_url":"https://api.github.com/users/brunopalos/followers","following_url":"https://api.github.com/users/brunopalos/following{/other_user}","gists_url":"https://api.github.com/users/brunopalos/gists{/gist_id}","starred_url":"https://api.github.com/users/brunopalos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunopalos/subscriptions","organizations_url":"https://api.github.com/users/brunopalos/orgs","repos_url":"https://api.github.com/users/brunopalos/repos","events_url":"https://api.github.com/users/brunopalos/events{/privacy}","received_events_url":"https://api.github.com/users/brunopalos/received_events","type":"User","site_admin":false},"body":"Well, I also considered that when developing this code but `ScheduledThreadPoolExecutor` is a `Futures` queue our abstraction used `Runables`, so I decided only to check the queue length to limit the queue size. Yeah... it sucks :/","created_at":"2016-11-14T10:51:04Z","updated_at":"2016-11-14T10:51:04Z","html_url":"https://github.com/statful/statful-client-java/pull/5#discussion_r87776602","pull_request_url":"https://api.github.com/repos/statful/statful-client-java/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/comments/87776602"},"html":{"href":"https://github.com/statful/statful-client-java/pull/5#discussion_r87776602"},"pull_request":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/statful/statful-client-java/pulls/5","id":93377089,"html_url":"https://github.com/statful/statful-client-java/pull/5","diff_url":"https://github.com/statful/statful-client-java/pull/5.diff","patch_url":"https://github.com/statful/statful-client-java/pull/5.patch","issue_url":"https://api.github.com/repos/statful/statful-client-java/issues/5","number":5,"state":"open","locked":false,"title":"Fix client to handle ScheduledThreadPoolExecutor internal tasks queue…","user":{"login":"brunopalos","id":3313946,"avatar_url":"https://avatars.githubusercontent.com/u/3313946?v=3","gravatar_id":"","url":"https://api.github.com/users/brunopalos","html_url":"https://github.com/brunopalos","followers_url":"https://api.github.com/users/brunopalos/followers","following_url":"https://api.github.com/users/brunopalos/following{/other_user}","gists_url":"https://api.github.com/users/brunopalos/gists{/gist_id}","starred_url":"https://api.github.com/users/brunopalos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunopalos/subscriptions","organizations_url":"https://api.github.com/users/brunopalos/orgs","repos_url":"https://api.github.com/users/brunopalos/repos","events_url":"https://api.github.com/users/brunopalos/events{/privacy}","received_events_url":"https://api.github.com/users/brunopalos/received_events","type":"User","site_admin":false},"body":"… to avoid memory leaks.","created_at":"2016-11-11T18:35:23Z","updated_at":"2016-11-14T10:51:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0f28e3dd0f8c63861bcf2d1f42771502277058c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/statful/statful-client-java/pulls/5/commits","review_comments_url":"https://api.github.com/repos/statful/statful-client-java/pulls/5/comments","review_comment_url":"https://api.github.com/repos/statful/statful-client-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/statful/statful-client-java/issues/5/comments","statuses_url":"https://api.github.com/repos/statful/statful-client-java/statuses/1d2a2062a7cc4300b47e28723eab06ccf2308192","head":{"label":"statful:memory-fix","ref":"memory-fix","sha":"1d2a2062a7cc4300b47e28723eab06ccf2308192","user":{"login":"statful","id":20299158,"avatar_url":"https://avatars.githubusercontent.com/u/20299158?v=3","gravatar_id":"","url":"https://api.github.com/users/statful","html_url":"https://github.com/statful","followers_url":"https://api.github.com/users/statful/followers","following_url":"https://api.github.com/users/statful/following{/other_user}","gists_url":"https://api.github.com/users/statful/gists{/gist_id}","starred_url":"https://api.github.com/users/statful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statful/subscriptions","organizations_url":"https://api.github.com/users/statful/orgs","repos_url":"https://api.github.com/users/statful/repos","events_url":"https://api.github.com/users/statful/events{/privacy}","received_events_url":"https://api.github.com/users/statful/received_events","type":"Organization","site_admin":false},"repo":{"id":64424185,"name":"statful-client-java","full_name":"statful/statful-client-java","owner":{"login":"statful","id":20299158,"avatar_url":"https://avatars.githubusercontent.com/u/20299158?v=3","gravatar_id":"","url":"https://api.github.com/users/statful","html_url":"https://github.com/statful","followers_url":"https://api.github.com/users/statful/followers","following_url":"https://api.github.com/users/statful/following{/other_user}","gists_url":"https://api.github.com/users/statful/gists{/gist_id}","starred_url":"https://api.github.com/users/statful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statful/subscriptions","organizations_url":"https://api.github.com/users/statful/orgs","repos_url":"https://api.github.com/users/statful/repos","events_url":"https://api.github.com/users/statful/events{/privacy}","received_events_url":"https://api.github.com/users/statful/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/statful/statful-client-java","description":"Statful client for Java applications","fork":false,"url":"https://api.github.com/repos/statful/statful-client-java","forks_url":"https://api.github.com/repos/statful/statful-client-java/forks","keys_url":"https://api.github.com/repos/statful/statful-client-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/statful/statful-client-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/statful/statful-client-java/teams","hooks_url":"https://api.github.com/repos/statful/statful-client-java/hooks","issue_events_url":"https://api.github.com/repos/statful/statful-client-java/issues/events{/number}","events_url":"https://api.github.com/repos/statful/statful-client-java/events","assignees_url":"https://api.github.com/repos/statful/statful-client-java/assignees{/user}","branches_url":"https://api.github.com/repos/statful/statful-client-java/branches{/branch}","tags_url":"https://api.github.com/repos/statful/statful-client-java/tags","blobs_url":"https://api.github.com/repos/statful/statful-client-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/statful/statful-client-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/statful/statful-client-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/statful/statful-client-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/statful/statful-client-java/statuses/{sha}","languages_url":"https://api.github.com/repos/statful/statful-client-java/languages","stargazers_url":"https://api.github.com/repos/statful/statful-client-java/stargazers","contributors_url":"https://api.github.com/repos/statful/statful-client-java/contributors","subscribers_url":"https://api.github.com/repos/statful/statful-client-java/subscribers","subscription_url":"https://api.github.com/repos/statful/statful-client-java/subscription","commits_url":"https://api.github.com/repos/statful/statful-client-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/statful/statful-client-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/statful/statful-client-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/statful/statful-client-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/statful/statful-client-java/contents/{+path}","compare_url":"https://api.github.com/repos/statful/statful-client-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/statful/statful-client-java/merges","archive_url":"https://api.github.com/repos/statful/statful-client-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/statful/statful-client-java/downloads","issues_url":"https://api.github.com/repos/statful/statful-client-java/issues{/number}","pulls_url":"https://api.github.com/repos/statful/statful-client-java/pulls{/number}","milestones_url":"https://api.github.com/repos/statful/statful-client-java/milestones{/number}","notifications_url":"https://api.github.com/repos/statful/statful-client-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/statful/statful-client-java/labels{/name}","releases_url":"https://api.github.com/repos/statful/statful-client-java/releases{/id}","deployments_url":"https://api.github.com/repos/statful/statful-client-java/deployments","created_at":"2016-07-28T19:56:26Z","updated_at":"2016-10-25T18:27:57Z","pushed_at":"2016-11-11T18:35:23Z","git_url":"git://github.com/statful/statful-client-java.git","ssh_url":"git@github.com:statful/statful-client-java.git","clone_url":"https://github.com/statful/statful-client-java.git","svn_url":"https://github.com/statful/statful-client-java","homepage":null,"size":327,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"statful:master","ref":"master","sha":"83b19267662cb3aa1462621cc116749861a0e39e","user":{"login":"statful","id":20299158,"avatar_url":"https://avatars.githubusercontent.com/u/20299158?v=3","gravatar_id":"","url":"https://api.github.com/users/statful","html_url":"https://github.com/statful","followers_url":"https://api.github.com/users/statful/followers","following_url":"https://api.github.com/users/statful/following{/other_user}","gists_url":"https://api.github.com/users/statful/gists{/gist_id}","starred_url":"https://api.github.com/users/statful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statful/subscriptions","organizations_url":"https://api.github.com/users/statful/orgs","repos_url":"https://api.github.com/users/statful/repos","events_url":"https://api.github.com/users/statful/events{/privacy}","received_events_url":"https://api.github.com/users/statful/received_events","type":"Organization","site_admin":false},"repo":{"id":64424185,"name":"statful-client-java","full_name":"statful/statful-client-java","owner":{"login":"statful","id":20299158,"avatar_url":"https://avatars.githubusercontent.com/u/20299158?v=3","gravatar_id":"","url":"https://api.github.com/users/statful","html_url":"https://github.com/statful","followers_url":"https://api.github.com/users/statful/followers","following_url":"https://api.github.com/users/statful/following{/other_user}","gists_url":"https://api.github.com/users/statful/gists{/gist_id}","starred_url":"https://api.github.com/users/statful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statful/subscriptions","organizations_url":"https://api.github.com/users/statful/orgs","repos_url":"https://api.github.com/users/statful/repos","events_url":"https://api.github.com/users/statful/events{/privacy}","received_events_url":"https://api.github.com/users/statful/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/statful/statful-client-java","description":"Statful client for Java applications","fork":false,"url":"https://api.github.com/repos/statful/statful-client-java","forks_url":"https://api.github.com/repos/statful/statful-client-java/forks","keys_url":"https://api.github.com/repos/statful/statful-client-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/statful/statful-client-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/statful/statful-client-java/teams","hooks_url":"https://api.github.com/repos/statful/statful-client-java/hooks","issue_events_url":"https://api.github.com/repos/statful/statful-client-java/issues/events{/number}","events_url":"https://api.github.com/repos/statful/statful-client-java/events","assignees_url":"https://api.github.com/repos/statful/statful-client-java/assignees{/user}","branches_url":"https://api.github.com/repos/statful/statful-client-java/branches{/branch}","tags_url":"https://api.github.com/repos/statful/statful-client-java/tags","blobs_url":"https://api.github.com/repos/statful/statful-client-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/statful/statful-client-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/statful/statful-client-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/statful/statful-client-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/statful/statful-client-java/statuses/{sha}","languages_url":"https://api.github.com/repos/statful/statful-client-java/languages","stargazers_url":"https://api.github.com/repos/statful/statful-client-java/stargazers","contributors_url":"https://api.github.com/repos/statful/statful-client-java/contributors","subscribers_url":"https://api.github.com/repos/statful/statful-client-java/subscribers","subscription_url":"https://api.github.com/repos/statful/statful-client-java/subscription","commits_url":"https://api.github.com/repos/statful/statful-client-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/statful/statful-client-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/statful/statful-client-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/statful/statful-client-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/statful/statful-client-java/contents/{+path}","compare_url":"https://api.github.com/repos/statful/statful-client-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/statful/statful-client-java/merges","archive_url":"https://api.github.com/repos/statful/statful-client-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/statful/statful-client-java/downloads","issues_url":"https://api.github.com/repos/statful/statful-client-java/issues{/number}","pulls_url":"https://api.github.com/repos/statful/statful-client-java/pulls{/number}","milestones_url":"https://api.github.com/repos/statful/statful-client-java/milestones{/number}","notifications_url":"https://api.github.com/repos/statful/statful-client-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/statful/statful-client-java/labels{/name}","releases_url":"https://api.github.com/repos/statful/statful-client-java/releases{/id}","deployments_url":"https://api.github.com/repos/statful/statful-client-java/deployments","created_at":"2016-07-28T19:56:26Z","updated_at":"2016-10-25T18:27:57Z","pushed_at":"2016-11-11T18:35:23Z","git_url":"git://github.com/statful/statful-client-java.git","ssh_url":"git@github.com:statful/statful-client-java.git","clone_url":"https://github.com/statful/statful-client-java.git","svn_url":"https://github.com/statful/statful-client-java","homepage":null,"size":327,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/5"},"html":{"href":"https://github.com/statful/statful-client-java/pull/5"},"issue":{"href":"https://api.github.com/repos/statful/statful-client-java/issues/5"},"comments":{"href":"https://api.github.com/repos/statful/statful-client-java/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/statful/statful-client-java/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/statful/statful-client-java/statuses/1d2a2062a7cc4300b47e28723eab06ccf2308192"}}}}
{"actor":{"display_login":"brunopalos"}}