add some stats

pull/11758/head
Craig Tiller 8 years ago
parent 2e9afc02ac
commit 073a88f4dd
  1. 6
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  2. 2
      src/core/lib/debug/stats_data.c
  3. 6
      src/core/lib/debug/stats_data.h
  4. 3
      src/core/lib/debug/stats_data.yaml

@ -938,6 +938,12 @@ static void write_action_begin_locked(grpc_exec_ctx *exec_ctx, void *gt,
r = grpc_chttp2_begin_write(exec_ctx, t); r = grpc_chttp2_begin_write(exec_ctx, t);
} }
if (r.writing) { if (r.writing) {
if (r.partial) {
GRPC_STATS_INC_HTTP2_PARTIAL_WRITES(exec_ctx);
}
if (!t->is_first_write_in_batch) {
GRPC_STATS_INC_HTTP2_WRITES_CONTINUED(exec_ctx);
}
grpc_closure_scheduler *scheduler = grpc_closure_scheduler *scheduler =
write_scheduler(t, r.early_results_scheduled, r.partial); write_scheduler(t, r.early_results_scheduled, r.partial);
if (scheduler != grpc_schedule_on_exec_ctx) { if (scheduler != grpc_schedule_on_exec_ctx) {

@ -43,6 +43,8 @@ const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
"http2_pings_sent", "http2_pings_sent",
"http2_writes_begun", "http2_writes_begun",
"http2_writes_offloaded", "http2_writes_offloaded",
"http2_writes_continued",
"http2_partial_writes",
"combiner_locks_initiated", "combiner_locks_initiated",
"combiner_locks_scheduled_items", "combiner_locks_scheduled_items",
"combiner_locks_scheduled_final_items", "combiner_locks_scheduled_final_items",

@ -45,6 +45,8 @@ typedef enum {
GRPC_STATS_COUNTER_HTTP2_PINGS_SENT, GRPC_STATS_COUNTER_HTTP2_PINGS_SENT,
GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN, GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN,
GRPC_STATS_COUNTER_HTTP2_WRITES_OFFLOADED, GRPC_STATS_COUNTER_HTTP2_WRITES_OFFLOADED,
GRPC_STATS_COUNTER_HTTP2_WRITES_CONTINUED,
GRPC_STATS_COUNTER_HTTP2_PARTIAL_WRITES,
GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED, GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED,
GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_ITEMS, GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_ITEMS,
GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS, GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS,
@ -128,6 +130,10 @@ typedef enum {
GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN) GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN)
#define GRPC_STATS_INC_HTTP2_WRITES_OFFLOADED(exec_ctx) \ #define GRPC_STATS_INC_HTTP2_WRITES_OFFLOADED(exec_ctx) \
GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_OFFLOADED) GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_OFFLOADED)
#define GRPC_STATS_INC_HTTP2_WRITES_CONTINUED(exec_ctx) \
GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_CONTINUED)
#define GRPC_STATS_INC_HTTP2_PARTIAL_WRITES(exec_ctx) \
GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_PARTIAL_WRITES)
#define GRPC_STATS_INC_COMBINER_LOCKS_INITIATED(exec_ctx) \ #define GRPC_STATS_INC_COMBINER_LOCKS_INITIATED(exec_ctx) \
GRPC_STATS_INC_COUNTER((exec_ctx), \ GRPC_STATS_INC_COUNTER((exec_ctx), \
GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED) GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED)

@ -58,6 +58,8 @@
- counter: http2_pings_sent - counter: http2_pings_sent
- counter: http2_writes_begun - counter: http2_writes_begun
- counter: http2_writes_offloaded - counter: http2_writes_offloaded
- counter: http2_writes_continued
- counter: http2_partial_writes
# combiner locks # combiner locks
- counter: combiner_locks_initiated - counter: combiner_locks_initiated
- counter: combiner_locks_scheduled_items - counter: combiner_locks_scheduled_items
@ -70,4 +72,3 @@
- counter: executor_wakeup_initiated - counter: executor_wakeup_initiated
- counter: executor_queue_drained - counter: executor_queue_drained
- counter: executor_push_retries - counter: executor_push_retries

Loading…
Cancel
Save