{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/72677233","id":72677233,"diff_hunk":"@@ -66,28 +76,43 @@ public void insertRollups(List<SingleRollupWriteContext> writeContexts) {\n         Map<ResultSetFuture, SingleRollupWriteContext> futureLocatorMap = new HashMap<ResultSetFuture, SingleRollupWriteContext>();\n         Timer.Context ctx = Instrumentation.getWriteTimerContext( writeContexts.get( 0 ).getDestinationCF().getName() );\n         try {\n-            for (SingleRollupWriteContext writeContext : writeContexts) {\n-                Rollup rollup = writeContext.getRollup();\n-                Locator locator = writeContext.getLocator();\n-                Granularity granularity = writeContext.getGranularity();\n-                int ttl = getTtl(locator, rollup.getRollupType(), granularity);\n-\n-                // lookup the right writer\n-                RollupType rollupType = writeContext.getRollup().getRollupType();\n-                DAbstractMetricIO io = getIO( rollupType.name().toLowerCase(), granularity );\n-\n-                ResultSetFuture future = io.putAsync(locator, writeContext.getTimestamp(), rollup, writeContext.getGranularity(), ttl);\n-                futureLocatorMap.put(future, writeContext);\n+            Timer.Context writeOnlyTimer = startWriteTimer();\n+            try {\n+                for (SingleRollupWriteContext writeContext : writeContexts) {\n+                    Rollup rollup = writeContext.getRollup();\n+                    Locator locator = writeContext.getLocator();\n+                    Granularity granularity = writeContext.getGranularity();\n+                    int ttl = getTtl(locator, rollup.getRollupType(), granularity);\n+\n+                    // lookup the right writer\n+                    RollupType rollupType = writeContext.getRollup().getRollupType();\n+                    DAbstractMetricIO io = getIO(rollupType.name().toLowerCase(), granularity);\n+\n+                    ResultSetFuture future = io.putAsync(locator, writeContext.getTimestamp(), rollup, writeContext.getGranularity(), ttl);\n+                    futureLocatorMap.put(future, writeContext);\n+                }\n+            } finally {\n+                writeOnlyTimer.stop();\n             }\n \n-            for (ResultSetFuture future : futureLocatorMap.keySet()) {\n-                try {\n-                    future.getUninterruptibly().all();\n-                } catch (Exception ex) {\n-                    Instrumentation.markWriteError();\n-                    SingleRollupWriteContext writeContext = futureLocatorMap.get(future);\n-                    LOG.error(String.format(\"error writing to locator %s, granularity %s\", writeContext.getLocator(), writeContext.getGranularity()), ex);\n+            try {\n+                for (final ResultSetFuture future : futureLocatorMap.keySet()) {\n+                    final SingleRollupWriteContext writeContext = futureLocatorMap.get(future);\n+                    Timer.Context resultsWaitTimer = startWaitResultsTimer();\n+                    try {\n+                        future.getUninterruptibly().all();\n+                    } catch (Exception ex) {\n+                        Instrumentation.markWriteError();\n+                        LOG.error(String.format(\"error writing locator %s, granularity %s, timestamp %d\",\n+                                        writeContext.getLocator(), writeContext.getGranularity(),\n+                                        writeContext.getTimestamp()),\n+                                ex);\n+                    } finally {\n+                        resultsWaitTimer.stop();\n+                    }\n                 }\n+            } finally {\n+","path":"blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricsRW.java","position":103,"original_position":103,"commit_id":"26b280a5c4304978c54c28b72fd5ab42b5368d0f","original_commit_id":"26b280a5c4304978c54c28b72fd5ab42b5368d0f","user":{"login":"usnavi","id":1426961,"avatar_url":"https://avatars.githubusercontent.com/u/1426961?v=3","gravatar_id":"","url":"https://api.github.com/users/usnavi","html_url":"https://github.com/usnavi","followers_url":"https://api.github.com/users/usnavi/followers","following_url":"https://api.github.com/users/usnavi/following{/other_user}","gists_url":"https://api.github.com/users/usnavi/gists{/gist_id}","starred_url":"https://api.github.com/users/usnavi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usnavi/subscriptions","organizations_url":"https://api.github.com/users/usnavi/orgs","repos_url":"https://api.github.com/users/usnavi/repos","events_url":"https://api.github.com/users/usnavi/events{/privacy}","received_events_url":"https://api.github.com/users/usnavi/received_events","type":"User","site_admin":false},"body":"is this try/finally block necessary?","created_at":"2016-07-28T18:35:13Z","updated_at":"2016-07-28T18:35:13Z","html_url":"https://github.com/rackerlabs/blueflood/pull/722#discussion_r72677233","pull_request_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/72677233"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/722#discussion_r72677233"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722","id":79055971,"html_url":"https://github.com/rackerlabs/blueflood/pull/722","diff_url":"https://github.com/rackerlabs/blueflood/pull/722.diff","patch_url":"https://github.com/rackerlabs/blueflood/pull/722.patch","issue_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/722","number":722,"state":"open","locked":false,"title":"adding more metrics for rollup","user":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"body":"The main purpose of this PR is to add a few more metrics to Rollup process. Changes include:\r\n* add the following metrics:\r\n  * meter for number of Rollup writes (to record num of Rollup writes per min rate)\r\n  * timers for the time it takes to submit a batch of Insert Statements using Datastax, for Basic and PreAggregated metrics\r\n  * timers for the individual time it takes to wait for the futures (i.e: for the Insert statements to be executed), for Basic and PreAggregated metrics\r\n* minor clarifications on some log statements\r\n","created_at":"2016-07-27T16:30:36Z","updated_at":"2016-07-28T18:35:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"472e93fe2f19c74ca7003bb8067306bd5f09339e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/722/comments","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/26b280a5c4304978c54c28b72fd5ab42b5368d0f","head":{"label":"shintasmith:dtx_rollup","ref":"dtx_rollup","sha":"26b280a5c4304978c54c28b72fd5ab42b5368d0f","user":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"repo":{"id":45861100,"name":"blueflood","full_name":"shintasmith/blueflood","owner":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shintasmith/blueflood","description":"A distributed system designed to ingest and process time series data","fork":true,"url":"https://api.github.com/repos/shintasmith/blueflood","forks_url":"https://api.github.com/repos/shintasmith/blueflood/forks","keys_url":"https://api.github.com/repos/shintasmith/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shintasmith/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shintasmith/blueflood/teams","hooks_url":"https://api.github.com/repos/shintasmith/blueflood/hooks","issue_events_url":"https://api.github.com/repos/shintasmith/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/shintasmith/blueflood/events","assignees_url":"https://api.github.com/repos/shintasmith/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/shintasmith/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/shintasmith/blueflood/tags","blobs_url":"https://api.github.com/repos/shintasmith/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shintasmith/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shintasmith/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/shintasmith/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shintasmith/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/shintasmith/blueflood/languages","stargazers_url":"https://api.github.com/repos/shintasmith/blueflood/stargazers","contributors_url":"https://api.github.com/repos/shintasmith/blueflood/contributors","subscribers_url":"https://api.github.com/repos/shintasmith/blueflood/subscribers","subscription_url":"https://api.github.com/repos/shintasmith/blueflood/subscription","commits_url":"https://api.github.com/repos/shintasmith/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/shintasmith/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/shintasmith/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/shintasmith/blueflood/issues/comments{/number}","contents_url":"https://api.github.com/repos/shintasmith/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/shintasmith/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shintasmith/blueflood/merges","archive_url":"https://api.github.com/repos/shintasmith/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shintasmith/blueflood/downloads","issues_url":"https://api.github.com/repos/shintasmith/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/shintasmith/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/shintasmith/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/shintasmith/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shintasmith/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/shintasmith/blueflood/releases{/id}","deployments_url":"https://api.github.com/repos/shintasmith/blueflood/deployments","created_at":"2015-11-09T19:22:42Z","updated_at":"2016-01-12T19:55:23Z","pushed_at":"2016-07-28T16:20:28Z","git_url":"git://github.com/shintasmith/blueflood.git","ssh_url":"git@github.com:shintasmith/blueflood.git","clone_url":"https://github.com/shintasmith/blueflood.git","svn_url":"https://github.com/shintasmith/blueflood","homepage":"http://www.blueflood.io","size":10361,"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":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"fb374a91e51a481c06b8095ee30e15c9e7d1165a","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":10081109,"name":"blueflood","full_name":"rackerlabs/blueflood","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/blueflood","description":"A distributed system designed to ingest and process time series data","fork":false,"url":"https://api.github.com/repos/rackerlabs/blueflood","forks_url":"https://api.github.com/repos/rackerlabs/blueflood/forks","keys_url":"https://api.github.com/repos/rackerlabs/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/blueflood/teams","hooks_url":"https://api.github.com/repos/rackerlabs/blueflood/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/blueflood/events","assignees_url":"https://api.github.com/repos/rackerlabs/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/blueflood/tags","blobs_url":"https://api.github.com/repos/rackerlabs/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/blueflood/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/blueflood/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/blueflood/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/blueflood/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/blueflood/subscription","commits_url":"https://api.github.com/repos/rackerlabs/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/blueflood/merges","archive_url":"https://api.github.com/repos/rackerlabs/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/blueflood/downloads","issues_url":"https://api.github.com/repos/rackerlabs/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/blueflood/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/blueflood/deployments","created_at":"2013-05-15T14:50:39Z","updated_at":"2016-07-27T05:54:38Z","pushed_at":"2016-07-28T16:20:28Z","git_url":"git://github.com/rackerlabs/blueflood.git","ssh_url":"git@github.com:rackerlabs/blueflood.git","clone_url":"https://github.com/rackerlabs/blueflood.git","svn_url":"https://github.com/rackerlabs/blueflood","homepage":"http://www.blueflood.io","size":13679,"stargazers_count":454,"watchers_count":454,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":28,"forks":67,"open_issues":28,"watchers":454,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/722"},"issue":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/722"},"comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/722/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/722/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/blueflood/statuses/26b280a5c4304978c54c28b72fd5ab42b5368d0f"}}}}
{"actor":{"display_login":"usnavi"}}