{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/97176562","pull_request_review_id":17784598,"id":97176562,"diff_hunk":"@@ -640,6 +650,81 @@ def _deDotKeys(self, res):\n     return res\n \n \n+class InfluxDBPublisher(SamplePublisher):\n+\n+  def __init__(self, influx_uri=None, influx_db_name=None):\n+    # set to default above in flags unless changed\n+    self.influx_uri = influx_uri\n+    self.influx_db_name = influx_db_name\n+\n+  def PublishSamples(self, samples):\n+    successful_http_request_codes = [200, 202, 204]\n+    sample = list(samples)\n+    number_of_samples = 0\n+    for sample in samples:\n+      number_of_samples += 1\n+      timestamp = int((10 ** 9) * sample['timestamp'])\n+      measurement = 'perfkitbenchmarker'\n+      tag_set_metadata = \\\n+          ', '.join(self.FormatSampleForInfluxDB(sample['metadata']))\n+      tag_set = ','.join((tag_set_metadata, self.\n+                          FormatSampleForInfluxDB({k: sample[k]\n+                                                   for k in ('test',\n+                                                             'official',\n+                                                             'owner',\n+                                                             'run_uri',\n+                                                             'sample_uri')})))\n+      field_set = '%s_%s=%s' % (self.FormatSampleForInfluxDB({k: sample[k]\n+                                for k in ('metric', 'unit', 'value')}))\n+      samples_constructed_body = (' '.join((','.join((measurement,\n+                                           tag_set))),\n+                                           (' '.join((field_set,\n+                                                     timestamp))))) + \"\\n\"\n+\n+    create_db_status, create_db_response = self. \\\n+        _createInfluxDB(self.influx_uri, self.influx_db_name)","path":"perfkitbenchmarker/publisher.py","position":67,"original_position":67,"commit_id":"b066284d5c6e0ffa4c5e4290bb0013eab5e13a3c","original_commit_id":"b066284d5c6e0ffa4c5e4290bb0013eab5e13a3c","user":{"login":"vhe182","id":9009649,"avatar_url":"https://avatars.githubusercontent.com/u/9009649?v=3","gravatar_id":"","url":"https://api.github.com/users/vhe182","html_url":"https://github.com/vhe182","followers_url":"https://api.github.com/users/vhe182/followers","following_url":"https://api.github.com/users/vhe182/following{/other_user}","gists_url":"https://api.github.com/users/vhe182/gists{/gist_id}","starred_url":"https://api.github.com/users/vhe182/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhe182/subscriptions","organizations_url":"https://api.github.com/users/vhe182/orgs","repos_url":"https://api.github.com/users/vhe182/repos","events_url":"https://api.github.com/users/vhe182/events{/privacy}","received_events_url":"https://api.github.com/users/vhe182/received_events","type":"User","site_admin":false},"body":"_createInfluxDB() isn't a function in this file.  Did you mean _createDB() ?\r\n","created_at":"2017-01-20T23:32:50Z","updated_at":"2017-01-20T23:43:12Z","html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278#discussion_r97176562","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/97176562"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278#discussion_r97176562"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278","id":102176561,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278","diff_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278.diff","patch_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/1278","number":1278,"state":"open","locked":false,"title":"This code aims to add the capability for PKB to publish directly to I…","user":{"login":"besanradwan","id":8431220,"avatar_url":"https://avatars.githubusercontent.com/u/8431220?v=3","gravatar_id":"","url":"https://api.github.com/users/besanradwan","html_url":"https://github.com/besanradwan","followers_url":"https://api.github.com/users/besanradwan/followers","following_url":"https://api.github.com/users/besanradwan/following{/other_user}","gists_url":"https://api.github.com/users/besanradwan/gists{/gist_id}","starred_url":"https://api.github.com/users/besanradwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/besanradwan/subscriptions","organizations_url":"https://api.github.com/users/besanradwan/orgs","repos_url":"https://api.github.com/users/besanradwan/repos","events_url":"https://api.github.com/users/besanradwan/events{/privacy}","received_events_url":"https://api.github.com/users/besanradwan/received_events","type":"User","site_admin":false},"body":"This code aims to add the capability for PKB to publish directly to InfluxDB\r\n\r\nThe publishing of data from PKB benchmarks can done either by specifiying a pre-existing Influx DB publisher or with none specified it will create a new one or re-use a pre-existing DB called perfkit. By default if no uri is specified it will publish the data to localhost.","created_at":"2017-01-19T00:05:22Z","updated_at":"2017-01-20T23:43:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f97b507c15d559e780d055421cd96a45c266d36c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/1278/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/b066284d5c6e0ffa4c5e4290bb0013eab5e13a3c","head":{"label":"besanradwan:influx_db_publisher","ref":"influx_db_publisher","sha":"b066284d5c6e0ffa4c5e4290bb0013eab5e13a3c","user":{"login":"besanradwan","id":8431220,"avatar_url":"https://avatars.githubusercontent.com/u/8431220?v=3","gravatar_id":"","url":"https://api.github.com/users/besanradwan","html_url":"https://github.com/besanradwan","followers_url":"https://api.github.com/users/besanradwan/followers","following_url":"https://api.github.com/users/besanradwan/following{/other_user}","gists_url":"https://api.github.com/users/besanradwan/gists{/gist_id}","starred_url":"https://api.github.com/users/besanradwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/besanradwan/subscriptions","organizations_url":"https://api.github.com/users/besanradwan/orgs","repos_url":"https://api.github.com/users/besanradwan/repos","events_url":"https://api.github.com/users/besanradwan/events{/privacy}","received_events_url":"https://api.github.com/users/besanradwan/received_events","type":"User","site_admin":false},"repo":{"id":47644493,"name":"PerfKitBenchmarker","full_name":"besanradwan/PerfKitBenchmarker","owner":{"login":"besanradwan","id":8431220,"avatar_url":"https://avatars.githubusercontent.com/u/8431220?v=3","gravatar_id":"","url":"https://api.github.com/users/besanradwan","html_url":"https://github.com/besanradwan","followers_url":"https://api.github.com/users/besanradwan/followers","following_url":"https://api.github.com/users/besanradwan/following{/other_user}","gists_url":"https://api.github.com/users/besanradwan/gists{/gist_id}","starred_url":"https://api.github.com/users/besanradwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/besanradwan/subscriptions","organizations_url":"https://api.github.com/users/besanradwan/orgs","repos_url":"https://api.github.com/users/besanradwan/repos","events_url":"https://api.github.com/users/besanradwan/events{/privacy}","received_events_url":"https://api.github.com/users/besanradwan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/besanradwan/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks are not tuned (i.e. use defaults) to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":true,"url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/releases{/id}","deployments_url":"https://api.github.com/repos/besanradwan/PerfKitBenchmarker/deployments","created_at":"2015-12-08T19:31:27Z","updated_at":"2016-11-17T17:21:12Z","pushed_at":"2017-01-19T00:03:36Z","git_url":"git://github.com/besanradwan/PerfKitBenchmarker.git","ssh_url":"git@github.com:besanradwan/PerfKitBenchmarker.git","clone_url":"https://github.com/besanradwan/PerfKitBenchmarker.git","svn_url":"https://github.com/besanradwan/PerfKitBenchmarker","homepage":"","size":7817,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"GoogleCloudPlatform:master","ref":"master","sha":"819bdf1c7d2fb3bd525fad541718da980f3e912e","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":21950910,"name":"PerfKitBenchmarker","full_name":"GoogleCloudPlatform/PerfKitBenchmarker","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks use defaults to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/deployments","created_at":"2014-07-17T17:23:26Z","updated_at":"2017-01-17T19:17:35Z","pushed_at":"2017-01-20T21:57:50Z","git_url":"git://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","ssh_url":"git@github.com:GoogleCloudPlatform/PerfKitBenchmarker.git","clone_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","svn_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","homepage":"","size":8084,"stargazers_count":755,"watchers_count":755,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":185,"mirror_url":null,"open_issues_count":152,"forks":185,"open_issues":152,"watchers":755,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/1278"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/1278"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/1278/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/1278/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/b066284d5c6e0ffa4c5e4290bb0013eab5e13a3c"}}}}
{"actor":{"display_login":"vhe182"}}