| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| :param key: The name of the label. | ||
|
|
||
| :type value_type: string | ||
| :param value_type: The type of the label. It must be one of ``"STRING"``, |
|
Awesome - this is great. I think we have a few high-level issues, but thanks so much for throwing this in. Issues I can see that we need to figure out:
Thanks again -- this is awesome |
Sorry, something went wrong.
|
To your points:
|
Sorry, something went wrong.
This initial version of the monitoring client for Datalab allows users
to query timeseries data. It introduces a new module under gcp that
users can import using:
from gcp.stackdriver import monitoring
Querying timeseries data:
There is a `Query` class that allows users to query timeseries data
for their monitored resources. They can initialize the query by specifying a
metric type and time interval, and refine it by adding filters to it.
The timeseries data is returned as a pandas DataFrame that allows users
to further manipulate the data and visualize it within Datalab.
IPython magics:
There are a couple of IPython magic commands to allow users to list
details of the available metrics and resource types. E.g.:
%%monitoring list metrics
The base library:
The _impl directory is a snapshot of an earlier version of a
monitoring client library that we have submitted to gcloud-python:
googleapis/google-cloud-python#1691
It works as the base library on top of which the Datalab library adds
interactive features.
The authors of this code are @rimey and myself, both at Google.
1. Removed start_time from the query constructor/factory. 2. Added a select_interval() method for when you actually do have a start time in your hands, or for when you want to set the time interval on an existing query object.
Several related changes: - Removed resource_type from the constructor/factory parameters. - Added support for filtering on "resource_type" as a pseudo-label. - Renamed select_resource_labels() to select_resources() and select_metric_labels() to select_metrics().
The signature of the reduce() method is now as follows:
reduce(self, cross_series_reducer, *group_by_fields)
I had dropped this, but I think we want it.
| resource = Resource._from_dict(info['resource']) | ||
| metric_kind = info['metricKind'] | ||
| value_type = info['valueType'] | ||
| points = [Point._from_dict(p) for p in info.get('points', [])] |
This initial version of the monitoring client for Datalab allows users
to query timeseries data. It introduces a new module under gcp that
users can import using:
from gcp.stackdriver import monitoring
Querying timeseries data:
There is a `Query` class that allows users to query timeseries data
for their monitored resources. They can initialize the query by specifying a
metric type and time interval, and refine it by adding filters to it.
The timeseries data is returned as a pandas DataFrame that allows users
to further manipulate the data and visualize it within Datalab.
IPython magics:
There are a couple of IPython magic commands to allow users to list
details of the available metrics and resource types. E.g.:
%%monitoring list metrics
The base library:
The _impl directory is a snapshot of an earlier version of a
monitoring client library that we have submitted to gcloud-python:
googleapis/google-cloud-python#1691
It works as the base library on top of which the Datalab library adds
interactive features.
The authors of this code are @rimey and myself, both at Google.
|
@rimey RE:
Only 4 left to get through |
Sorry, something went wrong.
|
@dhermes PTAL
Done.
Done.
Done for filter. I'd like to keep type.
I changed this code in the unit test to parse its constants using the timestamp format string in gcloud._helpers. I don't want to introduce time zone logic just so I can use a "DRY" helper function instead of a function from the Python standard library. Good enough? |
Sorry, something went wrong.
|
Yes I noticed! Thanks a lot. AFAICT you only use type as a positional argument in MetricDescriptor.__init__ and ResourceDescriptor.__init__. So the name is somewhat less important since positional. Though maybe that isn't true for you, I noticed most calls to these constructors uses all keyword args. As for setting self.type = type_, that isn't problematic since self.type is on the objects namespace, which cascades through self.__dict__, type(self).__dict__, and then down the MRO of the parent class. Thus there is no clobbering of __builtins__ when a builtin name is used as an instance / class property. Are you still opposed to changing type -> type_ given this distinction between positional argument and instance attribute? |
Sorry, something went wrong.
|
@dhermes I'd like to stick with type. You can't judge the external usage from my internal usage, and we will soon have more of both when we add creation and deletion of descriptors for custom metrics. |
Sorry, something went wrong.
|
I just sent out #1737 to re-enable to the redefined-builtin error. What clarity is lost when moving from type to type_? Do we think the extra typing will overwhelm the subset of users that decides to use it as a keyword rather than positional? |
Sorry, something went wrong.
|
@dhermes: Done, under protest. I don't agree with this decision, for reasons I have already explained. I intend to propose reverting the change later if it has a bad effect on the experience for end users. Okay? |
Sorry, something went wrong.
|
SGTM. Happy to have a non-blocking discussion in an issue. |
Sorry, something went wrong.
|
All issues are resolved, LGTM. I'm going to do a squash merge for the very first time. Here goes. |
Sorry, something went wrong.
This initial version of the monitoring client for Datalab allows users
to query timeseries data. It introduces a new module under gcp that
users can import using:
from gcp.stackdriver import monitoring
Querying timeseries data:
There is a `Query` class that allows users to query timeseries data
for their monitored resources. They can initialize the query by specifying a
metric type and time interval, and refine it by adding filters to it.
The timeseries data is returned as a pandas DataFrame that allows users
to further manipulate the data and visualize it within Datalab.
IPython magics:
There are a couple of IPython magic commands to allow users to list
details of the available metrics and resource types. E.g.:
%%monitoring list metrics
The base library:
The _impl directory is a snapshot of an earlier version of a
monitoring client library that we have submitted to gcloud-python:
googleapis/google-cloud-python#1691
It works as the base library on top of which the Datalab library adds
interactive features.
The authors of this code are @rimey and myself, both at Google.
* docs: ensure new line after colon * add comment * update goldens * add another test case * add another test case * remove test code
* chore: remove unused files * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…nning zonal system tests (#1691) chore: optimization to reduce number of open TCP connections while running zonal system tests 1. Increase `ulimit -n 10000` before ssh'ing into the VM where system tests for zonal buckets are running. 2. Delete `mrd` and `writer` instance and trigger `gc.collect()` ( this alone should suffice but increasing doing the above optimization to avoid future issues.
…to_gbq()` (#1691) * perf: defer query in `read_gbq` with wildcard tables * remove obsolete comments * use sql node instead of ibis table node to keep select * from omitting pseudocolumns Fixes this code sample: import bigframes.pandas as bpd df = bpd.read_gbq("bigquery-public-data.google_analytics_sample.ga_sessions_*") df[df["_TABLE_SUFFIX"] == "20161204"].peek() * test with cache and to_gbq * rename columns before caching * remove unnecessary comment * add missing import * do not materialize _TABLE_SUFFIX * fix unit tests * correct number of columns in cache with offsets * fix formatting * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert datetime change, max_results change * add pseudocolumns to node * fix unit tests * actually fix unit tests * try to rename as part of compile * use correct node for table schema * revert pseudocolumn addition * add tests for fix for invalid columns * revert cached changes --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This initial version of the monitoring client supports querying of time series, metric descriptors, and monitored resource descriptors.
The authors of this code are @supriyagarg and myself, both at Google.