Skip to content

Commit e6a0667

Browse files
author
Bill Prin
committed
Monitoring: Minor Style Fixups
From dhermes review comments
1 parent d3e28ce commit e6a0667

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docs/monitoring-usage.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,12 @@ However, ``DELTA`` is not supported for custom metrics.
326326
specified::
327327

328328
>>> client.write_point(metric=metric, resource=resource,
329-
... value=3.14, end_time=end_time) # API call
329+
... value=3.14, end_time=end_time) # API call
330330

331331
By default, ``end_time`` defaults to :meth:`~datetime.datetime.utcnow()`, so metrics can be written
332332
to the current time as follows::
333333

334-
>>> client.write_point(metric, resource, 3.14) # API call
334+
>>> client.write_point(metric, resource, 3.14) # API call
335335

336336
``CUMULATIVE`` metrics enable the monitoring system to compute rates of increase on metrics that
337337
sometimes reset, such as after a process restart. Without cumulative metrics, this
@@ -341,15 +341,15 @@ time should be re-used repeatedly as more points are written to the time series.
341341
In the examples below, the ``end_time`` again defaults to the current time::
342342

343343
>>> RESET = datetime.utcnow()
344-
>>> client.write_point(metric, resource, 3, start_time=RESET) # API call
345-
>>> client.write_point(metric, resource, 6, start_time=RESET) # API call
344+
>>> client.write_point(metric, resource, 3, start_time=RESET) # API call
345+
>>> client.write_point(metric, resource, 6, start_time=RESET) # API call
346346

347347
To write multiple ``TimeSeries`` in a single batch, you can use
348348
:meth:`~google.cloud.monitoring.client.write_time_series`::
349349

350350
>>> ts1 = client.time_series(metric1, resource, 3.14, end_time=end_time)
351351
>>> ts2 = client.time_series(metric2, resource, 42, end_time=end_time)
352-
>>> client.write_time_series([ts1, ts2]) # API call
352+
>>> client.write_time_series([ts1, ts2]) # API call
353353

354354
While multiple time series can be written in a single batch, each ``TimeSeries`` object sent to
355355
the API must only include a single point.

google/cloud/monitoring/timeseries.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ def _make_typed_value(value):
161161
:returns: A dict
162162
"""
163163
typed_value_map = {
164-
bool: "boolValue",
165-
int: "int64Value",
166-
float: "doubleValue",
167-
str: "stringValue",
168-
dict: "distributionValue",
164+
bool: 'boolValue',
165+
int: 'int64Value',
166+
float: 'doubleValue',
167+
str: 'stringValue',
168+
dict: 'distributionValue',
169169
}
170170
type_ = typed_value_map[type(value)]
171-
if type_ == "int64Value":
171+
if type_ == 'int64Value':
172172
value = str(value)
173173
return {type_: value}
174174

@@ -217,9 +217,9 @@ def _to_dict(self):
217217
"""
218218
info = {
219219
'interval': {
220-
'endTime': self.end_time
220+
'endTime': self.end_time,
221221
},
222-
'value': _make_typed_value(self.value)
222+
'value': _make_typed_value(self.value),
223223
}
224224

225225
if self.start_time is not None:

0 commit comments

Comments
 (0)