Example usage for com.amazonaws.metrics ServiceLatencyProvider getServiceMetricType

List of usage examples for com.amazonaws.metrics ServiceLatencyProvider getServiceMetricType

Introduction

In this page you can find the example usage for com.amazonaws.metrics ServiceLatencyProvider getServiceMetricType.

Prototype

public ServiceMetricType getServiceMetricType() 

Source Link

Usage

From source file:com.netflix.spectator.aws.SpectatorServiceMetricCollector.java

License:Apache License

@Override
public void collectLatency(ServiceLatencyProvider provider) {
    if (provider.getServiceMetricType() == AWSServiceMetrics.HttpClientGetConnectionTime) {
        long nanos = (long) (provider.getDurationMilli() * 1e6);
        clientGetConnectionTime.record(nanos, TimeUnit.NANOSECONDS);
    }/*from  ww  w . j  av  a2s . c  om*/
}