Example usage for com.amazonaws.services.cloudwatch.model MetricDatum withMetricName

List of usage examples for com.amazonaws.services.cloudwatch.model MetricDatum withMetricName

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudwatch.model MetricDatum withMetricName.

Prototype


public MetricDatum withMetricName(String metricName) 

Source Link

Document

The name of the metric.

Usage

From source file:com.netflix.servo.publish.cloudwatch.CloudWatchMetricObserver.java

License:Apache License

MetricDatum createMetricDatum(Metric metric) {
    MetricDatum metricDatum = new MetricDatum();

    return metricDatum.withMetricName(metric.getConfig().getName())
            .withDimensions(createDimensions(metric.getConfig().getTags())).withUnit("None")//DataSourceTypeToAwsUnit.getUnit(metric.))
            .withTimestamp(new Date(metric.getTimestamp())).withValue(truncate(metric.getNumberValue()));
    //TODO Need to convert into reasonable units based on DataType
}