File tree Expand file tree Collapse file tree
monitoring/api/v3/cloud-client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,16 +74,20 @@ def list_time_series_header():
7474def list_time_series_aggregate ():
7575 client = monitoring .Client ()
7676 metric = 'compute.googleapis.com/instance/cpu/utilization'
77- print (list (client .query (metric , hours = 1 ).align (
78- monitoring .Aligner .ALIGN_MEAN , minutes = 5 )))
77+ query_results = client .query (metric , hours = 1 ).align (
78+ monitoring .Aligner .ALIGN_MEAN , minutes = 5 )
79+ for result in query_results :
80+ print (result )
7981
8082
8183def list_time_series_reduce ():
8284 client = monitoring .Client ()
8385 metric = 'compute.googleapis.com/instance/cpu/utilization'
84- print ( list ( client .query (metric , hours = 1 ).align (
86+ query_results = client .query (metric , hours = 1 ).align (
8587 monitoring .Aligner .ALIGN_MEAN , minutes = 5 ).reduce (
86- monitoring .Reducer .REDUCE_MEAN , 'resource.zone' )))
88+ monitoring .Reducer .REDUCE_MEAN , 'resource.zone' )
89+ for result in query_results :
90+ print (result )
8791
8892
8993def list_metric_descriptors ():
You can’t perform that action at this time.
0 commit comments