From 753670158c769d6bc9474f2a1af6c3405ffcea01 Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Fri, 20 Jan 2017 11:31:17 -0800 Subject: [PATCH 1/3] Fix monitoring usage doc --- docs/monitoring-usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/monitoring-usage.rst b/docs/monitoring-usage.rst index f9b04cae5573..6a82b825fcba 100644 --- a/docs/monitoring-usage.rst +++ b/docs/monitoring-usage.rst @@ -343,7 +343,7 @@ See `Monitored resource types`_ for more information about particular monitored ... 'zone': 'us-central1-f' ... }) >>> # Create a Metric object, specifying the metric type as well as values for any metric labels. - >>> metric = client.metric(type='custom.googleapis.com/my_metric', labels={ + >>> metric = client.metric(type_='custom.googleapis.com/my_metric', labels={ ... 'status': 'successful' ... }) From b1203aa5d22cbc920caa4ffd18ceb2156f1ee5ce Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Fri, 20 Jan 2017 16:41:26 -0800 Subject: [PATCH 2/3] dhermes review --- docs/monitoring-usage.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/monitoring-usage.rst b/docs/monitoring-usage.rst index 6a82b825fcba..49aa24a02def 100644 --- a/docs/monitoring-usage.rst +++ b/docs/monitoring-usage.rst @@ -338,14 +338,20 @@ See `Monitored resource types`_ for more information about particular monitored >>> from google.cloud import monitoring >>> # Create a Resource object for the desired monitored resource type. - >>> resource = client.resource('gce_instance', labels={ - ... 'instance_id': '1234567890123456789', - ... 'zone': 'us-central1-f' - ... }) + >>> resource = client.resource( + ... 'gce_instance', + ... labels={ + ... 'instance_id': '1234567890123456789', + ... 'zone': 'us-central1-f' + ... } + ... ) >>> # Create a Metric object, specifying the metric type as well as values for any metric labels. - >>> metric = client.metric(type_='custom.googleapis.com/my_metric', labels={ - ... 'status': 'successful' - ... }) + >>> metric = client.metric( + ... type_='custom.googleapis.com/my_metric', + ... labels={ + ... 'status': 'successful' + ... } + ... ) With a ``Metric`` and ``Resource`` in hand, the :class:`~google.cloud.monitoring.client.Client` can be used to write :class:`~google.cloud.monitoring.timeseries.Point` values. From 11e395e35b87c1694772adba6c2cf0eaf5bd6469 Mon Sep 17 00:00:00 2001 From: Bill Prin Date: Fri, 20 Jan 2017 16:58:56 -0800 Subject: [PATCH 3/3] dhermes review 2 --- docs/monitoring-usage.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/monitoring-usage.rst b/docs/monitoring-usage.rst index 49aa24a02def..2f0408264ea8 100644 --- a/docs/monitoring-usage.rst +++ b/docs/monitoring-usage.rst @@ -339,12 +339,12 @@ See `Monitored resource types`_ for more information about particular monitored >>> from google.cloud import monitoring >>> # Create a Resource object for the desired monitored resource type. >>> resource = client.resource( - ... 'gce_instance', - ... labels={ - ... 'instance_id': '1234567890123456789', - ... 'zone': 'us-central1-f' - ... } - ... ) + ... 'gce_instance', + ... labels={ + ... 'instance_id': '1234567890123456789', + ... 'zone': 'us-central1-f' + ... } + ... ) >>> # Create a Metric object, specifying the metric type as well as values for any metric labels. >>> metric = client.metric( ... type_='custom.googleapis.com/my_metric',