Exemplo n.º 1
0
 public async Task <MetricDescriptor> CreateMetricAsync(MetricDescriptor metricDescriptor)
 {
     return(await _client.CreateMetricDescriptorAsync(new CreateMetricDescriptorRequest
     {
         ProjectName = _projectName,
         MetricDescriptor = metricDescriptor
     }));
 }
Exemplo n.º 2
0
        public async Task CreateMetricDescriptorAsync()
        {
            // Snippet: CreateMetricDescriptorAsync(string,MetricDescriptor,CallSettings)
            // Additional: CreateMetricDescriptorAsync(string,MetricDescriptor,CancellationToken)
            // Create client
            MetricServiceClient metricServiceClient = MetricServiceClient.Create();
            // Initialize request argument(s)
            string           formattedName    = MetricServiceClient.FormatProjectName("[PROJECT]");
            MetricDescriptor metricDescriptor = new MetricDescriptor();
            // Make the request
            MetricDescriptor response = await metricServiceClient.CreateMetricDescriptorAsync(formattedName, metricDescriptor);

            // End snippet
        }
Exemplo n.º 3
0
        /// <summary>Snippet for CreateMetricDescriptorAsync</summary>
        public async Task CreateMetricDescriptorAsync_RequestObject()
        {
            // Snippet: CreateMetricDescriptorAsync(CreateMetricDescriptorRequest,CallSettings)
            // Create client
            MetricServiceClient metricServiceClient = await MetricServiceClient.CreateAsync();

            // Initialize request argument(s)
            CreateMetricDescriptorRequest request = new CreateMetricDescriptorRequest
            {
                ProjectName      = new ProjectName("[PROJECT]"),
                MetricDescriptor = new MetricDescriptor(),
            };
            // Make the request
            MetricDescriptor response = await metricServiceClient.CreateMetricDescriptorAsync(request);

            // End snippet
        }