Esempio n. 1
0
        public void Map_CanMapPrometheusMetricDefinition()
        {
            // Arrange
            var resource = new GenericAzureMetricDefinitionV1 {
                Name = "promitor_metric"
            };

            // Act
            var definition = _mapper.Map <MetricDefinition>(resource);

            // Assert
            Assert.NotNull(definition.PrometheusMetricDefinition);
            Assert.Equal(resource.Name, definition.PrometheusMetricDefinition.Name);
        }
        public MetricsDeclarationBuilder WithGenericMetric(string metricName = "foo", string metricDescription = "Description for a metric", string resourceUri = "Microsoft.ServiceBus/namespaces/promitor-messaging", string filter = "EntityName eq \'orders\'", string azureMetricName = "Total")
        {
            var azureMetricConfiguration = CreateAzureMetricConfiguration(azureMetricName);
            var metric = new GenericAzureMetricDefinitionV1
            {
                Name        = metricName,
                Description = metricDescription,
                ResourceUri = resourceUri,
                Filter      = filter,
                AzureMetricConfiguration = azureMetricConfiguration
            };

            _metrics.Add(metric);

            return(this);
        }