{"action":"created","comment":{"url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/comments/29618329","id":29618329,"diff_hunk":"@@ -0,0 +1,75 @@\n+package metrics_influxdb;\n+\n+import java.util.Collection;\n+import org.joda.time.DateTime;\n+\n+class JsonBuilderV9 implements JsonBuilder {\n+\tprivate final StringBuilder pointsJson = new StringBuilder();\n+\n+\tprivate boolean hasSeriesData;\n+\n+\tprivate String metadata;\n+\n+\tpublic JsonBuilderV9(String database, String precision) {\n+\t\tmetadata = \"{\\\"database\\\":\\\"\" + database + \"\\\",\\\"precision\\\":\\\"\" + precision + \"\\\",\";\n+\t}\n+\n+\t@Override\n+\tpublic boolean hasSeriesData() {\n+\t\treturn hasSeriesData;\n+\t}\n+\n+\t@Override\n+\tpublic void reset() {\n+\t\tpointsJson.setLength(0);\n+\t\tpointsJson.append(\"\\\"points\\\":[\");\n+\t\thasSeriesData = false;\n+\t}\n+\n+\t@Override\n+\tpublic String toJsonString() {\n+\t\tpointsJson.append(']');\n+\t\tString str = metadata + pointsJson.toString() + \"}\";\n+\t\tpointsJson.setLength(pointsJson.length() - 1);\n+\t\treturn str;\n+\t}\n+\n+\t@Override\n+\tpublic void appendSeries(String namePrefix, String name, String nameSuffix, String[] columns, Object[][] points) {\n+\t\tif (hasSeriesData)\n+\t\t\tpointsJson.append(',');\n+\t\thasSeriesData = true;\n+\t\tfinal DateTime timestamp = new DateTime();\n+\t\tpointsJson.append(\"{\\\"name\\\":\\\"\").append(namePrefix).append(name).append(nameSuffix).append(\"\\\",\\\"fields\\\":{\");\n+\t\tObject[] row = points[0];\n+\t\tfor (int j = 1; j < row.length; j++) {","path":"src/main/java/metrics_influxdb/JsonBuilderV9.java","position":45,"original_position":45,"commit_id":"b7a4aa7565ee6ae97e6b4ab08f3660c2d09c5040","original_commit_id":"b7a4aa7565ee6ae97e6b4ab08f3660c2d09c5040","user":{"login":"mwuertinger","id":3739231,"avatar_url":"https://avatars.githubusercontent.com/u/3739231?v=3","gravatar_id":"","url":"https://api.github.com/users/mwuertinger","html_url":"https://github.com/mwuertinger","followers_url":"https://api.github.com/users/mwuertinger/followers","following_url":"https://api.github.com/users/mwuertinger/following{/other_user}","gists_url":"https://api.github.com/users/mwuertinger/gists{/gist_id}","starred_url":"https://api.github.com/users/mwuertinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwuertinger/subscriptions","organizations_url":"https://api.github.com/users/mwuertinger/orgs","repos_url":"https://api.github.com/users/mwuertinger/repos","events_url":"https://api.github.com/users/mwuertinger/events{/privacy}","received_events_url":"https://api.github.com/users/mwuertinger/received_events","type":"User","site_admin":false},"body":"Why exactly is this loop starting at 1?","created_at":"2015-05-04T20:10:06Z","updated_at":"2015-05-04T20:10:06Z","html_url":"https://github.com/davidB/metrics-influxdb/pull/20#discussion_r29618329","pull_request_url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/comments/29618329"},"html":{"href":"https://github.com/davidB/metrics-influxdb/pull/20#discussion_r29618329"},"pull_request":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20","id":34649729,"html_url":"https://github.com/davidB/metrics-influxdb/pull/20","diff_url":"https://github.com/davidB/metrics-influxdb/pull/20.diff","patch_url":"https://github.com/davidB/metrics-influxdb/pull/20.patch","issue_url":"https://api.github.com/repos/davidB/metrics-influxdb/issues/20","number":20,"state":"open","locked":false,"title":"Add support for Influxdb V0.9","user":{"login":"leelasharma","id":6091337,"avatar_url":"https://avatars.githubusercontent.com/u/6091337?v=3","gravatar_id":"","url":"https://api.github.com/users/leelasharma","html_url":"https://github.com/leelasharma","followers_url":"https://api.github.com/users/leelasharma/followers","following_url":"https://api.github.com/users/leelasharma/following{/other_user}","gists_url":"https://api.github.com/users/leelasharma/gists{/gist_id}","starred_url":"https://api.github.com/users/leelasharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leelasharma/subscriptions","organizations_url":"https://api.github.com/users/leelasharma/orgs","repos_url":"https://api.github.com/users/leelasharma/repos","events_url":"https://api.github.com/users/leelasharma/events{/privacy}","received_events_url":"https://api.github.com/users/leelasharma/received_events","type":"User","site_admin":false},"body":"* Adding a JsonBuilder as per Influxdb v0.9 request format\r\n* Adding a InfluxdbHttpV9Reporter to the test\r\n* Updating InfluxdbHttp and InfluxdbUdp to use the new json builder based on the version.","created_at":"2015-05-04T16:02:11Z","updated_at":"2015-05-04T20:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7bdb148944991c66f508ef8fc4a8ed4339e555b4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20/commits","review_comments_url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20/comments","review_comment_url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davidB/metrics-influxdb/issues/20/comments","statuses_url":"https://api.github.com/repos/davidB/metrics-influxdb/statuses/b7a4aa7565ee6ae97e6b4ab08f3660c2d09c5040","head":{"label":"leelasharma:feature/influxv9","ref":"feature/influxv9","sha":"b7a4aa7565ee6ae97e6b4ab08f3660c2d09c5040","user":{"login":"leelasharma","id":6091337,"avatar_url":"https://avatars.githubusercontent.com/u/6091337?v=3","gravatar_id":"","url":"https://api.github.com/users/leelasharma","html_url":"https://github.com/leelasharma","followers_url":"https://api.github.com/users/leelasharma/followers","following_url":"https://api.github.com/users/leelasharma/following{/other_user}","gists_url":"https://api.github.com/users/leelasharma/gists{/gist_id}","starred_url":"https://api.github.com/users/leelasharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leelasharma/subscriptions","organizations_url":"https://api.github.com/users/leelasharma/orgs","repos_url":"https://api.github.com/users/leelasharma/repos","events_url":"https://api.github.com/users/leelasharma/events{/privacy}","received_events_url":"https://api.github.com/users/leelasharma/received_events","type":"User","site_admin":false},"repo":{"id":35042997,"name":"metrics-influxdb","full_name":"leelasharma/metrics-influxdb","owner":{"login":"leelasharma","id":6091337,"avatar_url":"https://avatars.githubusercontent.com/u/6091337?v=3","gravatar_id":"","url":"https://api.github.com/users/leelasharma","html_url":"https://github.com/leelasharma","followers_url":"https://api.github.com/users/leelasharma/followers","following_url":"https://api.github.com/users/leelasharma/following{/other_user}","gists_url":"https://api.github.com/users/leelasharma/gists{/gist_id}","starred_url":"https://api.github.com/users/leelasharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leelasharma/subscriptions","organizations_url":"https://api.github.com/users/leelasharma/orgs","repos_url":"https://api.github.com/users/leelasharma/repos","events_url":"https://api.github.com/users/leelasharma/events{/privacy}","received_events_url":"https://api.github.com/users/leelasharma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leelasharma/metrics-influxdb","description":"A reporter for metrics which announces measurements to an InfluxDB server.","fork":true,"url":"https://api.github.com/repos/leelasharma/metrics-influxdb","forks_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/forks","keys_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/teams","hooks_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/hooks","issue_events_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/events","assignees_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/tags","blobs_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/languages","stargazers_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/stargazers","contributors_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/contributors","subscribers_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/subscribers","subscription_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/subscription","commits_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/merges","archive_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/downloads","issues_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/labels{/name}","releases_url":"https://api.github.com/repos/leelasharma/metrics-influxdb/releases{/id}","created_at":"2015-05-04T15:31:41Z","updated_at":"2015-05-04T15:31:42Z","pushed_at":"2015-05-04T15:58:11Z","git_url":"git://github.com/leelasharma/metrics-influxdb.git","ssh_url":"git@github.com:leelasharma/metrics-influxdb.git","clone_url":"https://github.com/leelasharma/metrics-influxdb.git","svn_url":"https://github.com/leelasharma/metrics-influxdb","homepage":"","size":372,"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":"davidB:master","ref":"master","sha":"a29a906ad33a69a63dcf9d672c04076f31d58ffb","user":{"login":"davidB","id":10675,"avatar_url":"https://avatars.githubusercontent.com/u/10675?v=3","gravatar_id":"","url":"https://api.github.com/users/davidB","html_url":"https://github.com/davidB","followers_url":"https://api.github.com/users/davidB/followers","following_url":"https://api.github.com/users/davidB/following{/other_user}","gists_url":"https://api.github.com/users/davidB/gists{/gist_id}","starred_url":"https://api.github.com/users/davidB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidB/subscriptions","organizations_url":"https://api.github.com/users/davidB/orgs","repos_url":"https://api.github.com/users/davidB/repos","events_url":"https://api.github.com/users/davidB/events{/privacy}","received_events_url":"https://api.github.com/users/davidB/received_events","type":"User","site_admin":false},"repo":{"id":16432430,"name":"metrics-influxdb","full_name":"davidB/metrics-influxdb","owner":{"login":"davidB","id":10675,"avatar_url":"https://avatars.githubusercontent.com/u/10675?v=3","gravatar_id":"","url":"https://api.github.com/users/davidB","html_url":"https://github.com/davidB","followers_url":"https://api.github.com/users/davidB/followers","following_url":"https://api.github.com/users/davidB/following{/other_user}","gists_url":"https://api.github.com/users/davidB/gists{/gist_id}","starred_url":"https://api.github.com/users/davidB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidB/subscriptions","organizations_url":"https://api.github.com/users/davidB/orgs","repos_url":"https://api.github.com/users/davidB/repos","events_url":"https://api.github.com/users/davidB/events{/privacy}","received_events_url":"https://api.github.com/users/davidB/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidB/metrics-influxdb","description":"A reporter for metrics which announces measurements to an InfluxDB server.","fork":false,"url":"https://api.github.com/repos/davidB/metrics-influxdb","forks_url":"https://api.github.com/repos/davidB/metrics-influxdb/forks","keys_url":"https://api.github.com/repos/davidB/metrics-influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidB/metrics-influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidB/metrics-influxdb/teams","hooks_url":"https://api.github.com/repos/davidB/metrics-influxdb/hooks","issue_events_url":"https://api.github.com/repos/davidB/metrics-influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/davidB/metrics-influxdb/events","assignees_url":"https://api.github.com/repos/davidB/metrics-influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/davidB/metrics-influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/davidB/metrics-influxdb/tags","blobs_url":"https://api.github.com/repos/davidB/metrics-influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidB/metrics-influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidB/metrics-influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidB/metrics-influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidB/metrics-influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/davidB/metrics-influxdb/languages","stargazers_url":"https://api.github.com/repos/davidB/metrics-influxdb/stargazers","contributors_url":"https://api.github.com/repos/davidB/metrics-influxdb/contributors","subscribers_url":"https://api.github.com/repos/davidB/metrics-influxdb/subscribers","subscription_url":"https://api.github.com/repos/davidB/metrics-influxdb/subscription","commits_url":"https://api.github.com/repos/davidB/metrics-influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidB/metrics-influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidB/metrics-influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidB/metrics-influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidB/metrics-influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/davidB/metrics-influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidB/metrics-influxdb/merges","archive_url":"https://api.github.com/repos/davidB/metrics-influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidB/metrics-influxdb/downloads","issues_url":"https://api.github.com/repos/davidB/metrics-influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/davidB/metrics-influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/davidB/metrics-influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/davidB/metrics-influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidB/metrics-influxdb/labels{/name}","releases_url":"https://api.github.com/repos/davidB/metrics-influxdb/releases{/id}","created_at":"2014-02-01T10:50:23Z","updated_at":"2015-04-29T04:07:04Z","pushed_at":"2015-05-04T16:02:11Z","git_url":"git://github.com/davidB/metrics-influxdb.git","ssh_url":"git@github.com:davidB/metrics-influxdb.git","clone_url":"https://github.com/davidB/metrics-influxdb.git","svn_url":"https://github.com/davidB/metrics-influxdb","homepage":"","size":372,"stargazers_count":70,"watchers_count":70,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":4,"forks":24,"open_issues":4,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20"},"html":{"href":"https://github.com/davidB/metrics-influxdb/pull/20"},"issue":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/issues/20"},"comments":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/davidB/metrics-influxdb/statuses/b7a4aa7565ee6ae97e6b4ab08f3660c2d09c5040"}}}}