File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ async function readTimeSeriesAggregate(projectId) {
289
289
// [START monitoring_read_timeseries_align]
290
290
// Imports the Google Cloud client library
291
291
const monitoring = require ( '@google-cloud/monitoring' ) ;
292
+ const util = require ( 'util' ) ;
292
293
293
294
// Creates a client
294
295
const client = new monitoring . MetricServiceClient ( ) ;
@@ -323,13 +324,13 @@ async function readTimeSeriesAggregate(projectId) {
323
324
const [ timeSeries ] = await client . listTimeSeries ( request ) ;
324
325
console . log ( 'CPU utilization:' ) ;
325
326
timeSeries . forEach ( data => {
326
- console . log ( data ) ;
327
- for ( const point of data . points ) {
328
- console . log ( point ) ;
329
- }
330
327
console . log ( data . metric . labels . instance_name ) ;
328
+ for ( const p of data . points ) {
329
+ console . log ( util . inspect ( p ) ) ;
330
+ }
331
331
console . log ( ` Now: ${ data . points [ 0 ] . value . doubleValue } ` ) ;
332
332
console . log ( ` 10 min ago: ${ data . points [ 1 ] . value . doubleValue } ` ) ;
333
+ console . log ( `=====` ) ;
333
334
} ) ;
334
335
// [END monitoring_read_timeseries_align]
335
336
}
You can’t perform that action at this time.
0 commit comments