@@ -115,11 +115,13 @@ void createMetricDescriptor(String type) throws IOException {
115
115
* @param name Name of metric descriptor to delete
116
116
*/
117
117
void deleteMetricDescriptor (String name ) throws IOException {
118
+ // [START monitoring_delete_metric]
118
119
String projectId = System .getProperty ("projectId" );
119
120
final MetricServiceClient client = MetricServiceClient .create ();
120
121
MetricDescriptorName metricName = MetricDescriptorName .create (projectId , name );
121
122
client .deleteMetricDescriptor (metricName );
122
123
System .out .println ("Deleted descriptor " + name );
124
+ // [END monitoring_delete_metric]
123
125
}
124
126
125
127
/**
@@ -447,15 +449,15 @@ void listMonitoredResources() throws IOException {
447
449
for (MonitoredResourceDescriptor d : descriptors ) {
448
450
System .out .println (d .getType ());
449
451
}
450
- // [START monitoring_list_resources]
452
+ // [END monitoring_list_resources]
451
453
}
452
454
453
455
/**
454
456
* Gets full information for a monitored resource.
455
457
* @param The resource type
456
458
*/
457
459
void describeMonitoredResources (String type ) throws IOException {
458
- // [START monitoring_list_resources ]
460
+ // [START monitoring_get_descriptor ]
459
461
// Your Google Cloud Platform project ID
460
462
String projectId = System .getProperty ("projectId" );
461
463
@@ -465,8 +467,7 @@ void describeMonitoredResources(String type) throws IOException {
465
467
466
468
System .out .println ("Printing monitored resource descriptor: " );
467
469
System .out .println (response );
468
-
469
- // [END monitoring_list_resources]
470
+ // [END monitoring_get_descriptor]
470
471
}
471
472
472
473
0 commit comments