示例#1
0
        public string Build(IMapper mapper)
        {
            var metricsDeclaration = new MetricsDeclarationV1
            {
                Version        = SpecVersion.v1.ToString(),
                AzureMetadata  = _azureMetadata,
                MetricDefaults = _metricDefaults,
                Metrics        = _metrics
            };

            _v1Deserializer = V1DeserializerFactory.CreateDeserializer();

            var configurationSerializer = new ConfigurationSerializer(NullLogger.Instance, mapper, _v1Deserializer);

            return(configurationSerializer.Serialize(metricsDeclaration));
        }
示例#2
0
 public MetricsDeclarationProviderStub(string rawMetricsDeclaration, IMapper mapper) : base(null, new ConfigurationSerializer(NullLogger <ConfigurationSerializer> .Instance, mapper, V1DeserializerFactory.CreateDeserializer()))
 {
     _rawMetricsDeclaration = rawMetricsDeclaration;
 }
示例#3
0
 public MetricsDeclarationProviderStub(string rawMetricsDeclaration, IMapper mapper) : base(configuration: null, logger: NullLogger.Instance, mapper: mapper, v1Deserializer: V1DeserializerFactory.CreateDeserializer())
 {
     _rawMetricsDeclaration = rawMetricsDeclaration;
 }