Пример #1
0
        bool ValidatePutRequestBody(PutMetricDataRequest request, MetricData data, CloudWatchMetricPersisterConfiguration configuration)
        {
            Assert.That(request.Namespace, Is.EqualTo(configuration.Namespace));

            Assert.That(request.MetricData, Has.Exactly(1).InstanceOf <MetricDatum>());

            return(true);
        }
Пример #2
0
        bool ValidateMetricDatum(PutMetricDataRequest request, MetricData data, CloudWatchMetricPersisterConfiguration configuration)
        {
            var metric = configuration.Metrics[0];

            var datum = request.MetricData[0];

            Assert.That(datum.Value, Is.EqualTo(data.Metrics[metric.Metric].ReadAsDouble()));

            Assert.That(datum.Unit, Is.EqualTo(metric.Unit));

            Assert.That(datum.StorageResolution, Is.EqualTo((int)metric.StorageResolution));

            return(true);
        }
Пример #3
0
        bool ValidateMetricDatumDimensions(PutMetricDataRequest request, MetricData data, CloudWatchMetricPersisterConfiguration configuration)
        {
            var metric = configuration.Metrics[0];

            var datum = request.MetricData[0];

            Assert.That(datum.Dimensions, Has.Exactly(metric.Dimensions.Count).InstanceOf <Dimension>());

            return(true);
        }