{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/75235009","id":75235009,"diff_hunk":"@@ -195,6 +203,129 @@ def metric_descriptor(self, type_,\n             display_name=display_name,\n         )\n \n+    @staticmethod\n+    def metric(type_, labels):\n+        \"\"\"Factory for constructing metric objects.\n+\n+        :class:`~gcloud.monitoring.metric.Metric` objects are typically\n+        created to write custom metric values. The type should match the\n+        metric type specified in the\n+        :class:`~gcloud.monitoring.metric.MetricDescriptor` used\n+        create the custom metric::\n+\n+             >>> metric = client.metric('custom.googleapis.com/my_metric',\n+             ...                        labels={\n+             ...                            'instance_name': 'my-instance',\n+             ...                         })\n+\n+        :type type_: string\n+        :param type_: The metric type name.\n+\n+        :type labels: dict\n+        :param labels: A mapping from label names to values for all labels\n+                       enumerated in the associated\n+                       :class:`~gcloud.monitoring.metric.MetricDescriptor`.\n+\n+        :rtype: :class:`~gcloud.monitoring.metric.Metric`\n+        :returns: The metric instance.\n+        \"\"\"\n+        return Metric(type=type_, labels=labels)\n+\n+    @staticmethod\n+    def resource(type_, labels):\n+        \"\"\"Factory for constructing monitored resource instances.\n+\n+        Creating a monitored resource (represented by\n+        :class:`~gcloud.monitoring.resource.Resource`) object, which is\n+        typically used when writing custom\n+        :class:`~gcloud.monitoring.timeseries.TimeSeries`.\n+\n+        For a list of possible monitored resource types and their associated\n+        labels, see:\n+\n+        https://cloud.google.com/monitoring/api/resources\n+\n+        :type type_: string\n+        :param type_: The monitored resource\n+                      (:class:`~gcloud.monitoring.resource.Resource`) type\n+                      name.\n+\n+        :type labels: dict\n+        :param labels: A mapping from label names to values for all labels\n+                       enumerated in the associated\n+                       :class:`~gcloud.monitoring.resource.ResourceDescriptor`,\n+                       except that `project_id` can and should be omitted\n+                       when writing time series data.\n+\n+        :rtype: :class:`~gcloud.monitoring.resource.Resource`\n+        :returns: A resource instance\n+        \"\"\"\n+        return Resource(type_, labels)\n+\n+    @staticmethod\n+    def time_series(metric, resource, value,\n+                    end_time=None, start_time=None):\n+        \"\"\"Constructs a time series object for a single data point.\n+\n+        .. note::\n+\n+           While :class:`~gcloud.monitoring.timeseries.TimeSeries` objects\n+           returned by the API typically have multiple data point,\n+           :class:`~gcloud.monitoring.timeseries.TimeSeries`","path":"gcloud/monitoring/client.py","position":95,"original_position":95,"commit_id":"808a102598c38661e2d3bc3568d1a21da8606872","original_commit_id":"808a102598c38661e2d3bc3568d1a21da8606872","user":{"login":"rimey","id":360806,"avatar_url":"https://avatars.githubusercontent.com/u/360806?v=3","gravatar_id":"","url":"https://api.github.com/users/rimey","html_url":"https://github.com/rimey","followers_url":"https://api.github.com/users/rimey/followers","following_url":"https://api.github.com/users/rimey/following{/other_user}","gists_url":"https://api.github.com/users/rimey/gists{/gist_id}","starred_url":"https://api.github.com/users/rimey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rimey/subscriptions","organizations_url":"https://api.github.com/users/rimey/orgs","repos_url":"https://api.github.com/users/rimey/repos","events_url":"https://api.github.com/users/rimey/events{/privacy}","received_events_url":"https://api.github.com/users/rimey/received_events","type":"User","site_admin":false},"body":"Add \"objects\".","created_at":"2016-08-18T01:12:41Z","updated_at":"2016-08-18T01:12:41Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071#discussion_r75235009","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/75235009"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071#discussion_r75235009"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071","id":80666150,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/2071","number":2071,"state":"open","locked":false,"title":"Add Factory Methods for Metric/Resource/Timeseries","user":{"login":"waprin","id":1075173,"avatar_url":"https://avatars.githubusercontent.com/u/1075173?v=3","gravatar_id":"","url":"https://api.github.com/users/waprin","html_url":"https://github.com/waprin","followers_url":"https://api.github.com/users/waprin/followers","following_url":"https://api.github.com/users/waprin/following{/other_user}","gists_url":"https://api.github.com/users/waprin/gists{/gist_id}","starred_url":"https://api.github.com/users/waprin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waprin/subscriptions","organizations_url":"https://api.github.com/users/waprin/orgs","repos_url":"https://api.github.com/users/waprin/repos","events_url":"https://api.github.com/users/waprin/events{/privacy}","received_events_url":"https://api.github.com/users/waprin/received_events","type":"User","site_admin":false},"body":"@rimey @supriyagarg \r\n\r\ncc @sharbison3","created_at":"2016-08-09T18:00:35Z","updated_at":"2016-08-18T01:12:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10530a6e9ce1cade3ce58fd6d461eeb1d8b477b2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/2071/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/808a102598c38661e2d3bc3568d1a21da8606872","head":{"label":"waprin:monitoring_factories","ref":"monitoring_factories","sha":"808a102598c38661e2d3bc3568d1a21da8606872","user":{"login":"waprin","id":1075173,"avatar_url":"https://avatars.githubusercontent.com/u/1075173?v=3","gravatar_id":"","url":"https://api.github.com/users/waprin","html_url":"https://github.com/waprin","followers_url":"https://api.github.com/users/waprin/followers","following_url":"https://api.github.com/users/waprin/following{/other_user}","gists_url":"https://api.github.com/users/waprin/gists{/gist_id}","starred_url":"https://api.github.com/users/waprin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waprin/subscriptions","organizations_url":"https://api.github.com/users/waprin/orgs","repos_url":"https://api.github.com/users/waprin/repos","events_url":"https://api.github.com/users/waprin/events{/privacy}","received_events_url":"https://api.github.com/users/waprin/received_events","type":"User","site_admin":false},"repo":{"id":60732333,"name":"gcloud-python","full_name":"waprin/gcloud-python","owner":{"login":"waprin","id":1075173,"avatar_url":"https://avatars.githubusercontent.com/u/1075173?v=3","gravatar_id":"","url":"https://api.github.com/users/waprin","html_url":"https://github.com/waprin","followers_url":"https://api.github.com/users/waprin/followers","following_url":"https://api.github.com/users/waprin/following{/other_user}","gists_url":"https://api.github.com/users/waprin/gists{/gist_id}","starred_url":"https://api.github.com/users/waprin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waprin/subscriptions","organizations_url":"https://api.github.com/users/waprin/orgs","repos_url":"https://api.github.com/users/waprin/repos","events_url":"https://api.github.com/users/waprin/events{/privacy}","received_events_url":"https://api.github.com/users/waprin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/waprin/gcloud-python","description":"Google Cloud Client Library for Python","fork":true,"url":"https://api.github.com/repos/waprin/gcloud-python","forks_url":"https://api.github.com/repos/waprin/gcloud-python/forks","keys_url":"https://api.github.com/repos/waprin/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/waprin/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/waprin/gcloud-python/teams","hooks_url":"https://api.github.com/repos/waprin/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/waprin/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/waprin/gcloud-python/events","assignees_url":"https://api.github.com/repos/waprin/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/waprin/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/waprin/gcloud-python/tags","blobs_url":"https://api.github.com/repos/waprin/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/waprin/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/waprin/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/waprin/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/waprin/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/waprin/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/waprin/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/waprin/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/waprin/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/waprin/gcloud-python/subscription","commits_url":"https://api.github.com/repos/waprin/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/waprin/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/waprin/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/waprin/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/waprin/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/waprin/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/waprin/gcloud-python/merges","archive_url":"https://api.github.com/repos/waprin/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/waprin/gcloud-python/downloads","issues_url":"https://api.github.com/repos/waprin/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/waprin/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/waprin/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/waprin/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/waprin/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/waprin/gcloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/waprin/gcloud-python/deployments","created_at":"2016-06-08T21:34:51Z","updated_at":"2016-06-08T21:34:55Z","pushed_at":"2016-08-17T23:59:23Z","git_url":"git://github.com/waprin/gcloud-python.git","ssh_url":"git@github.com:waprin/gcloud-python.git","clone_url":"https://github.com/waprin/gcloud-python.git","svn_url":"https://github.com/waprin/gcloud-python","homepage":"https://googlecloudplatform.github.io/gcloud-python/","size":58083,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"a310ca92c3433742eab87fe55b3ee7e19a8abbb0","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":16316451,"name":"gcloud-python","full_name":"GoogleCloudPlatform/gcloud-python","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/gcloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/deployments","created_at":"2014-01-28T15:51:47Z","updated_at":"2016-08-17T20:25:46Z","pushed_at":"2016-08-17T23:59:24Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-python","homepage":"https://googlecloudplatform.github.io/gcloud-python/","size":71699,"stargazers_count":370,"watchers_count":370,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":189,"mirror_url":null,"open_issues_count":165,"forks":189,"open_issues":165,"watchers":370,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/2071"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/2071"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/2071/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/2071/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/808a102598c38661e2d3bc3568d1a21da8606872"}}}}
{"actor":{"display_login":"rimey"}}