Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Upgrade google.cloud.monitoring #702

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion google/datalab/stackdriver/monitoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

from __future__ import absolute_import

from google.cloud.monitoring import Aligner, Reducer
from google.cloud.monitoring import enums

Aligner = enums.Aggregation.Aligner
Reducer = enums.Aggregation.Reducer

from ._group import Groups
from ._metric import MetricDescriptors
from ._query import Query
Expand Down
12 changes: 6 additions & 6 deletions google/datalab/stackdriver/monitoring/_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

from __future__ import absolute_import

import google.cloud.monitoring
import google.cloud.monitoring_v3.query

from . import _query_metadata
from . import _utils


class Query(google.cloud.monitoring.Query):
class Query(google.cloud.monitoring_v3.query.Query):
"""Query object for retrieving metric data."""

def __init__(self,
metric_type=google.cloud.monitoring.Query.DEFAULT_METRIC_TYPE,
metric_type=google.cloud.monitoring_v3.query.Query.DEFAULT_METRIC_TYPE,
end_time=None, days=0, hours=0, minutes=0, context=None):
"""Initializes the core query parameters.

Expand All @@ -33,13 +33,13 @@ def __init__(self,
the resulting duration from the end time.

It is also allowed to omit the end time and duration here,
in which case :meth:`~google.cloud.monitoring.query.Query.select_interval`
in which case :meth:`~google.cloud.monitoring_v3.query.Query.select_interval`
must be called before the query is executed.

Args:
metric_type: The metric type name. The default value is
:data:`Query.DEFAULT_METRIC_TYPE
<google.cloud.monitoring.query.Query.DEFAULT_METRIC_TYPE>`, but
<google.cloud.monitoring_v3.query.Query.DEFAULT_METRIC_TYPE>`, but
please note that this default value is provided only for
demonstration purposes and is subject to change.
end_time: The end time (inclusive) of the time interval for which
Expand All @@ -54,7 +54,7 @@ def __init__(self,
ValueError: ``end_time`` was specified but ``days``, ``hours``, and
``minutes`` are all zero. If you really want to specify a point in
time, use
:meth:`~google.cloud.monitoring.query.Query.select_interval`.
:meth:`~google.cloud.monitoring_v3.query.Query.select_interval`.
"""
client = _utils.make_client(context)
super(Query, self).__init__(client, metric_type,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
'configparser>=3.5.0',
'mock>=2.0.0',
'future>=0.16.0',
'google-cloud>=0.30.0',
'google-cloud-monitoring>=0.30.1',
'google-api-python-client>=1.6.2',
'seaborn>=0.7.0',
'plotly>=1.12.5',
Expand Down