Skip to content

Commit

Permalink
Make DownstreamTiming a struct, instead of a class (#36473)
Browse files Browse the repository at this point in the history
Commit Message: Make DownstreamTiming a struct, instead of a class
Additional Description:This makes it consistent with UpstreamTiming, and
makes it easier to dependency inject timing info for testing.
Risk Level: WCPGW
Testing: None
Docs Changes: None
Release Notes: None
Platform Specific Features: None

Signed-off-by: Thomas Habets <[email protected]>
  • Loading branch information
ThomasHabets authored Oct 7, 2024
1 parent 0d6e453 commit 563ec60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions envoy/stream_info/stream_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ struct UpstreamTiming {
absl::optional<MonotonicTime> upstream_handshake_complete_;
};

class DownstreamTiming {
public:
struct DownstreamTiming {
void setValue(absl::string_view key, MonotonicTime value) { timings_[key] = value; }

absl::optional<MonotonicTime> getValue(absl::string_view value) const {
Expand Down Expand Up @@ -410,7 +409,6 @@ class DownstreamTiming {
last_downstream_header_rx_byte_received_ = time_source.monotonicTime();
}

private:
absl::flat_hash_map<std::string, MonotonicTime> timings_;
// The time when the last byte of the request was received.
absl::optional<MonotonicTime> last_downstream_rx_byte_received_;
Expand Down

0 comments on commit 563ec60

Please sign in to comment.