• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package software.amazon.awssdk.crt.http;
2 
3 public class HttpManagerMetrics {
4     private final long availableConcurrency;
5     private final long pendingConcurrencyAcquires;
6     private final long leasedConcurrency;
7 
HttpManagerMetrics(long availableConcurrency, long pendingConcurrencyAcquires, long leasedConcurrency)8     HttpManagerMetrics(long availableConcurrency, long pendingConcurrencyAcquires, long leasedConcurrency) {
9         this.availableConcurrency = availableConcurrency;
10         this.pendingConcurrencyAcquires = pendingConcurrencyAcquires;
11         this.leasedConcurrency = leasedConcurrency;
12     }
13 
14     /**
15      * @return The number of additional concurrent requests that can be supported by the HTTP manager without needing to
16      * establish additional connections to the target server.
17      * <p>
18      * For connection manager, this value represents idle connections.
19      * For stream manager, this value represents the number of streams that are possible to be made without creating new
20      * connections, although the implementation can create new connection without fully filling it.
21      */
getAvailableConcurrency()22     public long getAvailableConcurrency() {
23         return availableConcurrency;
24     }
25 
26     /**
27      * @return The number of requests that are awaiting concurrency to be made available from the HTTP manager.
28      */
getPendingConcurrencyAcquires()29     public long getPendingConcurrencyAcquires() {
30         return pendingConcurrencyAcquires;
31     }
32 
33     /**
34      * @return the amount of concurrency units currently out for lease. For http 1.1 this will be connections while
35      * for http2 this will be number of streams leased out.
36      */
getLeasedConcurrency()37     public long getLeasedConcurrency() {
38         return this.leasedConcurrency;
39     }
40 }
41