-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for metrics in stream response handler (#738)
- Loading branch information
Showing
8 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/main/java/software/amazon/awssdk/crt/http/HttpStreamMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package software.amazon.awssdk.crt.http; | ||
|
||
/** | ||
* Holds tracing metrics for an HTTP stream. Maps to `struct aws_http_stream_metrics` in **aws-c-http**'s | ||
* **request_response.h**. | ||
*/ | ||
public class HttpStreamMetrics { | ||
private final long sendStartTimestampNs; | ||
private final long sendEndTimestampNs; | ||
private final long sendingDurationNs; | ||
private final long receiveStartTimestampNs; | ||
private final long receiveEndTimestampNs; | ||
private final long receivingDurationNs; | ||
private final int streamId; | ||
|
||
HttpStreamMetrics( | ||
long sendStartTimestampNs, | ||
long sendEndTimestampNs, | ||
long sendingDurationNs, | ||
long receiveStartTimestampNs, | ||
long receiveEndTimestampNs, | ||
long receivingDurationNs, | ||
int streamId | ||
) { | ||
this.sendStartTimestampNs = sendStartTimestampNs; | ||
this.sendEndTimestampNs = sendEndTimestampNs; | ||
this.sendingDurationNs = sendingDurationNs; | ||
this.receiveStartTimestampNs = receiveStartTimestampNs; | ||
this.receiveEndTimestampNs = receiveEndTimestampNs; | ||
this.receivingDurationNs = receivingDurationNs; | ||
this.streamId = streamId; | ||
} | ||
|
||
public long getSendStartTimestampNs() { | ||
return sendStartTimestampNs; | ||
} | ||
|
||
public long getSendEndTimestampNs() { | ||
return sendEndTimestampNs; | ||
} | ||
|
||
public long getSendingDurationNs() { | ||
return sendingDurationNs; | ||
} | ||
|
||
public long getReceiveStartTimestampNs() { | ||
return receiveStartTimestampNs; | ||
} | ||
|
||
public long getReceiveEndTimestampNs() { | ||
return receiveEndTimestampNs; | ||
} | ||
|
||
public long getReceivingDurationNs() { | ||
return receivingDurationNs; | ||
} | ||
|
||
public int getStreamId() { | ||
return streamId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "HttpStreamMetrics{" + | ||
"sendStartTimestampNs=" + sendStartTimestampNs + | ||
", sendEndTimestampNs=" + sendEndTimestampNs + | ||
", sendingDurationNs=" + sendingDurationNs + | ||
", receiveStartTimestampNs=" + receiveStartTimestampNs + | ||
", receiveEndTimestampNs=" + receiveEndTimestampNs + | ||
", receivingDurationNs=" + receivingDurationNs + | ||
", streamId=" + streamId + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters