return bytesPerSec;
}
private void collectByteThroughput0(ByteThroughputProvider provider) {
final ThroughputMetricType throughputType = provider.getThroughputMetricType();
final ServiceMetricType byteCountType = throughputType.getByteCountMetricType();
final Set<MetricType> metrics = AwsSdkMetrics.getPredefinedMetrics();
final double byteCount = provider.getByteCount();
double durationNano = provider.getDurationNano();
double bytesPerSec = bytesPerSecond(byteCount, durationNano);
if (metrics.contains(throughputType)) {
// Throughput metric
final Dimension throughputDimension = new Dimension()
.withName(Dimensions.MetricType.name())
.withValue(throughputType.name());
final MetricDatum throughputDatum = new MetricDatum()
.withMetricName(throughputType.getServiceName())
.withDimensions(throughputDimension)
.withUnit(StandardUnit.BytesSecond)
.withValue(bytesPerSec);
safeAddMetricsToQueue(throughputDatum);
}
if (metrics.contains(byteCountType)) {
// Byte count metric
final Dimension byteCountDimension = new Dimension()
.withName(Dimensions.MetricType.name())
.withValue(byteCountType.name());
final MetricDatum byteCountDatum = new MetricDatum()
.withMetricName(byteCountType.getServiceName())
.withDimensions(byteCountDimension)
.withUnit(StandardUnit.Bytes)
.withValue(byteCount);
safeAddMetricsToQueue(byteCountDatum);
}