use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncCreateSetEndpoint method syncCreateSetEndpoint.
public static void syncCreateSetEndpoint() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
MetricsSettings metricsSettings = MetricsSettings.newBuilder().setEndpoint(myEndpoint).build();
MetricsClient metricsClient = MetricsClient.create(metricsSettings);
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class AsyncCreateLogMetric method asyncCreateLogMetric.
public static void asyncCreateLogMetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setMetric(LogMetric.newBuilder().build()).build();
ApiFuture<LogMetric> future = metricsClient.createLogMetricCallable().futureCall(request);
// Do something.
LogMetric response = future.get();
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncCreateLogMetricProjectnameLogmetric method syncCreateLogMetricProjectnameLogmetric.
public static void syncCreateLogMetricProjectnameLogmetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
LogMetric metric = LogMetric.newBuilder().build();
LogMetric response = metricsClient.createLogMetric(parent, metric);
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncCreateLogMetricStringLogmetric method syncCreateLogMetricStringLogmetric.
public static void syncCreateLogMetricStringLogmetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogMetric metric = LogMetric.newBuilder().build();
LogMetric response = metricsClient.createLogMetric(parent, metric);
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class AsyncDeleteLogMetric method asyncDeleteLogMetric.
public static void asyncDeleteLogMetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder().setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()).build();
ApiFuture<Empty> future = metricsClient.deleteLogMetricCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations