-
Notifications
You must be signed in to change notification settings - Fork 5.3k
techdebt: clean up connection_handler_impl dependency issue #15815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3515417
techdebt: clean up connection_handler_impl dependency issue
lambdai 734f4f4
fix build
lambdai 0c88b62
clean 1 TODO
lambdai 1795745
fix format pre
lambdai ae6b275
clang-format-11
lambdai ca8f46c
antother format fix
lambdai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,63 @@ | ||
| #pragma once | ||
|
|
||
| #include "envoy/network/connection_handler.h" | ||
| #include "envoy/network/listener.h" | ||
| #include "envoy/stats/scope.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Server { | ||
|
|
||
| #define ALL_LISTENER_STATS(COUNTER, GAUGE, HISTOGRAM) \ | ||
| COUNTER(downstream_cx_destroy) \ | ||
| COUNTER(downstream_cx_overflow) \ | ||
| COUNTER(downstream_cx_total) \ | ||
| COUNTER(downstream_cx_overload_reject) \ | ||
| COUNTER(downstream_global_cx_overflow) \ | ||
| COUNTER(downstream_pre_cx_timeout) \ | ||
| COUNTER(no_filter_chain_match) \ | ||
| GAUGE(downstream_cx_active, Accumulate) \ | ||
| GAUGE(downstream_pre_cx_active, Accumulate) \ | ||
| HISTOGRAM(downstream_cx_length_ms, Milliseconds) | ||
|
|
||
| /** | ||
| * Wrapper struct for listener stats. @see stats_macros.h | ||
| */ | ||
| struct ListenerStats { | ||
| ALL_LISTENER_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT, GENERATE_HISTOGRAM_STRUCT) | ||
| }; | ||
|
|
||
| #define ALL_PER_HANDLER_LISTENER_STATS(COUNTER, GAUGE) \ | ||
| COUNTER(downstream_cx_total) \ | ||
| GAUGE(downstream_cx_active, Accumulate) | ||
|
|
||
| /** | ||
| * Wrapper struct for per-handler listener stats. @see stats_macros.h | ||
| */ | ||
| struct PerHandlerListenerStats { | ||
| ALL_PER_HANDLER_LISTENER_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT) | ||
| }; | ||
|
|
||
| /** | ||
| * Wrapper for an active listener owned by this handler. | ||
| */ | ||
| class ActiveListenerImplBase : public virtual Network::ConnectionHandler::ActiveListener { | ||
| public: | ||
| ActiveListenerImplBase(Network::ConnectionHandler& parent, Network::ListenerConfig* config) | ||
| : stats_({ALL_LISTENER_STATS(POOL_COUNTER(config->listenerScope()), | ||
| POOL_GAUGE(config->listenerScope()), | ||
| POOL_HISTOGRAM(config->listenerScope()))}), | ||
| per_worker_stats_({ALL_PER_HANDLER_LISTENER_STATS( | ||
| POOL_COUNTER_PREFIX(config->listenerScope(), parent.statPrefix()), | ||
| POOL_GAUGE_PREFIX(config->listenerScope(), parent.statPrefix()))}), | ||
| config_(config) {} | ||
|
|
||
| // Network::ConnectionHandler::ActiveListener. | ||
| uint64_t listenerTag() override { return config_->listenerTag(); } | ||
|
|
||
| ListenerStats stats_; | ||
| PerHandlerListenerStats per_worker_stats_; | ||
| Network::ListenerConfig* config_{}; | ||
| }; | ||
|
|
||
| } // namespace Server | ||
| } // namespace Envoy |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functions is moved to bottom and constructor is now on the top