public async Task GetLogMetricAsync()
        {
            // Snippet: GetLogMetricAsync(string,CallSettings)
            // Additional: GetLogMetricAsync(string,CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.Create();
            // Initialize request argument(s)
            string formattedMetricName = MetricsServiceV2Client.FormatMetricName("[PROJECT]", "[METRIC]");
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(formattedMetricName);

            // End snippet
        }
Example #2
0
        /// <summary>Snippet for GetLogMetricAsync</summary>
        public async Task GetLogMetricAsync()
        {
            // Snippet: GetLogMetricAsync(MetricNameOneof,CallSettings)
            // Additional: GetLogMetricAsync(MetricNameOneof,CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            MetricNameOneof metricName = MetricNameOneof.From(new MetricName("[PROJECT]", "[METRIC]"));
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(metricName);

            // End snippet
        }
Example #3
0
        /// <summary>Snippet for GetLogMetricAsync</summary>
        public async Task GetLogMetricResourceNamesAsync()
        {
            // Snippet: GetLogMetricAsync(LogMetricName, CallSettings)
            // Additional: GetLogMetricAsync(LogMetricName, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            LogMetricName metricName = LogMetricName.FromProjectMetric("[PROJECT]", "[METRIC]");
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(metricName);

            // End snippet
        }
Example #4
0
        /// <summary>Snippet for GetLogMetricAsync</summary>
        public async Task GetLogMetricAsync()
        {
            // Snippet: GetLogMetricAsync(string, CallSettings)
            // Additional: GetLogMetricAsync(string, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            string metricName = "projects/[PROJECT]/metrics/[METRIC]";
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(metricName);

            // End snippet
        }
        public async Task GetLogMetricAsync_RequestObject()
        {
            // Snippet: GetLogMetricAsync(GetLogMetricRequest,CallSettings)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            GetLogMetricRequest request = new GetLogMetricRequest
            {
                MetricNameAsMetricNameOneof = MetricNameOneof.From(new MetricName("[PROJECT]", "[METRIC]")),
            };
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(request);

            // End snippet
        }
Example #6
0
        /// <summary>Snippet for GetLogMetricAsync</summary>
        public async Task GetLogMetricRequestObjectAsync()
        {
            // Snippet: GetLogMetricAsync(GetLogMetricRequest, CallSettings)
            // Additional: GetLogMetricAsync(GetLogMetricRequest, CancellationToken)
            // Create client
            MetricsServiceV2Client metricsServiceV2Client = await MetricsServiceV2Client.CreateAsync();

            // Initialize request argument(s)
            GetLogMetricRequest request = new GetLogMetricRequest
            {
                MetricNameAsLogMetricName = LogMetricName.FromProjectMetric("[PROJECT]", "[METRIC]"),
            };
            // Make the request
            LogMetric response = await metricsServiceV2Client.GetLogMetricAsync(request);

            // End snippet
        }