Example usage for com.amazonaws.util AWSServiceMetrics HttpClientGetConnectionTime

List of usage examples for com.amazonaws.util AWSServiceMetrics HttpClientGetConnectionTime

Introduction

In this page you can find the example usage for com.amazonaws.util AWSServiceMetrics HttpClientGetConnectionTime.

Prototype

AWSServiceMetrics HttpClientGetConnectionTime

To view the source code for com.amazonaws.util AWSServiceMetrics HttpClientGetConnectionTime.

Click Source Link

Document

Time taken to get a connection by the http client library.

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  w w w .  j a v a  2 s  . c  o  m
}