Revert "[experiments] Stabilize http2_stats_fix (#36351)" (#36362)

Missed a few steps before stabilizing this

Closes #36362

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36362 from yashykt:Revert36351 5110bc04ec
PiperOrigin-RevId: 625080972
pull/36355/head^2
Yash Tibrewal 7 months ago committed by Copybara-Service
parent 1cdbac9ceb
commit dbaeee2611
  1. 1
      bazel/experiments.bzl
  2. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  3. 3
      src/core/ext/transport/chttp2/transport/frame_data.cc
  4. 15
      src/core/lib/experiments/experiments.cc
  5. 11
      src/core/lib/experiments/experiments.h
  6. 6
      src/core/lib/experiments/experiments.yaml
  7. 3
      test/core/end2end/tests/http2_stats.cc

@ -25,6 +25,7 @@ EXPERIMENT_ENABLES = {
"event_engine_dns": "event_engine_dns",
"event_engine_listener": "event_engine_listener",
"free_large_allocator": "free_large_allocator",
"http2_stats_fix": "http2_stats_fix",
"keepalive_fix": "keepalive_fix",
"keepalive_server_fix": "keepalive_server_fix",
"monitoring_experiment": "monitoring_experiment",

@ -1471,9 +1471,11 @@ static void perform_stream_op_locked(void* stream_op,
frame_hdr[3] = static_cast<uint8_t>(len >> 8);
frame_hdr[4] = static_cast<uint8_t>(len);
if (grpc_core::IsHttp2StatsFixEnabled()) {
s->stats.outgoing.framing_bytes += GRPC_HEADER_SIZE_IN_BYTES;
s->stats.outgoing.data_bytes +=
op_payload->send_message.send_message->Length();
}
s->next_message_end_offset =
s->flow_controlled_bytes_written +
static_cast<int64_t>(s->flow_controlled_buffer.length) +

@ -78,6 +78,9 @@ void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
grpc_slice_buffer_move_first_no_ref(inbuf, write_bytes, outbuf);
stats->framing_bytes += header_size;
if (!grpc_core::IsHttp2StatsFixEnabled()) {
stats->data_bytes += write_bytes;
}
}
grpc_core::Poll<grpc_error_handle> grpc_deframe_unprocessed_incoming_frames(

@ -48,6 +48,9 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_http2_stats_fix =
"Fix on HTTP2 outgoing data stats reporting";
const char* const additional_constraints_http2_stats_fix = "{}";
const char* const description_keepalive_fix =
"Allows overriding keepalive_permit_without_calls. Refer "
"https://github.com/grpc/grpc/pull/33428 for more information.";
@ -162,6 +165,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, false, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"http2_stats_fix", description_http2_stats_fix,
additional_constraints_http2_stats_fix, nullptr, 0, true, true},
{"keepalive_fix", description_keepalive_fix,
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,
@ -243,6 +248,9 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_http2_stats_fix =
"Fix on HTTP2 outgoing data stats reporting";
const char* const additional_constraints_http2_stats_fix = "{}";
const char* const description_keepalive_fix =
"Allows overriding keepalive_permit_without_calls. Refer "
"https://github.com/grpc/grpc/pull/33428 for more information.";
@ -357,6 +365,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, true, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"http2_stats_fix", description_http2_stats_fix,
additional_constraints_http2_stats_fix, nullptr, 0, true, true},
{"keepalive_fix", description_keepalive_fix,
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,
@ -438,6 +448,9 @@ const char* const additional_constraints_event_engine_listener = "{}";
const char* const description_free_large_allocator =
"If set, return all free bytes from a \042big\042 allocator";
const char* const additional_constraints_free_large_allocator = "{}";
const char* const description_http2_stats_fix =
"Fix on HTTP2 outgoing data stats reporting";
const char* const additional_constraints_http2_stats_fix = "{}";
const char* const description_keepalive_fix =
"Allows overriding keepalive_permit_without_calls. Refer "
"https://github.com/grpc/grpc/pull/33428 for more information.";
@ -552,6 +565,8 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_event_engine_listener, nullptr, 0, true, true},
{"free_large_allocator", description_free_large_allocator,
additional_constraints_free_large_allocator, nullptr, 0, false, true},
{"http2_stats_fix", description_http2_stats_fix,
additional_constraints_http2_stats_fix, nullptr, 0, true, true},
{"keepalive_fix", description_keepalive_fix,
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,

@ -66,6 +66,8 @@ inline bool IsEventEngineClientEnabled() { return false; }
inline bool IsEventEngineDnsEnabled() { return false; }
inline bool IsEventEngineListenerEnabled() { return false; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_HTTP2_STATS_FIX
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@ -103,6 +105,8 @@ inline bool IsEventEngineDnsEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
inline bool IsEventEngineListenerEnabled() { return true; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_HTTP2_STATS_FIX
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@ -141,6 +145,8 @@ inline bool IsEventEngineDnsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
inline bool IsEventEngineListenerEnabled() { return true; }
inline bool IsFreeLargeAllocatorEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_HTTP2_STATS_FIX
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
@ -179,6 +185,7 @@ enum ExperimentIds {
kExperimentIdEventEngineDns,
kExperimentIdEventEngineListener,
kExperimentIdFreeLargeAllocator,
kExperimentIdHttp2StatsFix,
kExperimentIdKeepaliveFix,
kExperimentIdKeepaliveServerFix,
kExperimentIdMonitoringExperiment,
@ -233,6 +240,10 @@ inline bool IsEventEngineListenerEnabled() {
inline bool IsFreeLargeAllocatorEnabled() {
return IsExperimentEnabled(kExperimentIdFreeLargeAllocator);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_HTTP2_STATS_FIX
inline bool IsHttp2StatsFixEnabled() {
return IsExperimentEnabled(kExperimentIdHttp2StatsFix);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_KEEPALIVE_FIX
inline bool IsKeepaliveFixEnabled() {
return IsExperimentEnabled(kExperimentIdKeepaliveFix);

@ -98,6 +98,12 @@
expiry: 2024/08/01
owner: alishananda@google.com
test_tags: [resource_quota_test]
- name: http2_stats_fix
description:
Fix on HTTP2 outgoing data stats reporting
expiry: 2024/09/30
owner: yashkt@google.com
test_tags: []
- name: keepalive_fix
description:
Allows overriding keepalive_permit_without_calls.

@ -193,6 +193,9 @@ class NewFakeStatsPlugin : public FakeStatsPlugin {
// This test verifies the HTTP2 stats on a stream
CORE_END2END_TEST(Http2FullstackSingleHopTest, StreamStats) {
if (!IsHttp2StatsFixEnabled()) {
GTEST_SKIP() << "Test needs http2_stats_fix experiment to be enabled";
}
g_mu = new Mutex();
g_client_call_ended_notify = new Notification();
g_server_call_ended_notify = new Notification();

Loading…
Cancel
Save