stats: Pre-allocate codec stats for http1 and http2#11135
stats: Pre-allocate codec stats for http1 and http2#11135jmarantz merged 35 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
…location of an object. Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
…dental commits to coverage scripts. Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
This is really awesome. A couple of small comments. Also, this changes have a tendency to cause regressions in where the stats actually show up in the tree. Can you make sure some integration test actually verifies that they show up in the same place both for downstream and upstream? Maybe just add some checks to one of the protocol_integration_tests if they aren't already they? They can just be checks for stat existence IMO. Up to you. Thank you!
/wait
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
I'll look at adding some testing of the stat names; I don't see ton of testing for them in the integration tests. I really wish there were less integration-test specific classes though. It's not super-obvious to me that the flow for creating stats in integration tests is faithful to the way it happens in prod. Hold off on further review until I ping the next round, thanks. /wait |
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
@mattklein123 ptal; I have added some stat-checks and verified that these checks also work on when patched into master. I think this covers 3 of the 4 cases you suggested: dowsntream h1 and h2, and upstream h2. I could not find any cases in that test-suite where we were triggering h1 codec stats from upstream behavior. If you have an idea of where I might find one, I'd be happy to add it. |
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
update: just after writing the previous comment I re-read yours and agree it should be sufficient to test for stat existence, so I covered the remaining quadrant with that easily. Thanks! |
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Spencer Lewis <slewis@squareup.com> * master: (33 commits) docs: break release notes into categories (envoyproxy#11217) admin: extract more handlers to separate classes (envoyproxy#11258) Load reporting service documentation (envoyproxy#10962) http: testing 304-with-body behavior (envoyproxy#11261) fixing typos and breaking link issues (envoyproxy#11270) devex: initial commit of devcontainer setup (envoyproxy#11207) security: update policy for fix/disclosure SLOs. (envoyproxy#11243) http: fixing CONNECT to not advertise chunk encoding. (envoyproxy#11245) docs: update upstream network filters description (envoyproxy#11231) deps: update datadog tracer to v1.1.5 (envoyproxy#11253) test: Fix missing instantiation of parameterized tests. (envoyproxy#11247) fix go mirror when no changes (envoyproxy#11249) docs: host_rewrite -> host_rewrite_literal (envoyproxy#11229) wasm: update V8 to v8.3.110.9. (envoyproxy#11233) tls: update BoringSSL to 107c03cf (4103). (envoyproxy#11232) bazelci: always exclude nocoverage tag in coverage config (envoyproxy#11226) ci: save api revision in go-control-plane (envoyproxy#11220) build: fix cares build (envoyproxy#11225) stats: Pre-allocate codec stats for http1 and http2 (envoyproxy#11135) api: manifest based edge default documentation. (envoyproxy#11151) ...
| * Wrapper struct for the HTTP/1 codec stats. @see stats_macros.h | ||
| */ | ||
| struct CodecStats { | ||
| using AtomicPtr = Thread::AtomicPtr<CodecStats, Thread::AtomicPtrAllocMode::DeleteOnDestruct>; |
There was a problem hiding this comment.
Would it make sense if I moved these structs to a common codec_stats header? I want to share these structs between codecs and their forked legacy versions to avoid duplicating ClusterInfoImpl::http1CodecStats()
There was a problem hiding this comment.
Would be fine with me.
Note that the http3/quic ones may be a bit different (@danzh2010 ) because there are more of them and the master-list of them is maintained in an external codebase.
Commit Message: Lazy-init codec stats as part of ClusterInfo and pass them into the codecs, rather than recreating the stats on every connection.
Additional Description:
Risk Level: medium
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Fixes: #11069, #8324