blob: 4fff7694506017492d67e97a4691fbcaca8f4b32 [file] [log] [blame]
Craig Tiller28086682017-07-18 14:22:19 -07001/*
2 * Copyright 2017 gRPC authors.
Craig Tiller640dfe42017-08-30 13:34:49 -07003 *
Craig Tiller28086682017-07-18 14:22:19 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Craig Tiller640dfe42017-08-30 13:34:49 -07007 *
Craig Tiller28086682017-07-18 14:22:19 -07008 * http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller640dfe42017-08-30 13:34:49 -07009 *
Craig Tiller28086682017-07-18 14:22:19 -070010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * Automatically generated by tools/codegen/core/gen_stats_data.py
19 */
20
21#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H
22#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H
23
Craig Tiller640dfe42017-08-30 13:34:49 -070024#include <inttypes.h>
Craig Tiller97ec5eb2017-09-01 12:57:36 -070025#include "src/core/lib/iomgr/exec_ctx.h"
Craig Tiller640dfe42017-08-30 13:34:49 -070026
Craig Tiller28086682017-07-18 14:22:19 -070027typedef enum {
28 GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED,
29 GRPC_STATS_COUNTER_SERVER_CALLS_CREATED,
Craig Tillerb4bb1cd2017-07-20 14:18:17 -070030 GRPC_STATS_COUNTER_SYSCALL_WRITE,
31 GRPC_STATS_COUNTER_SYSCALL_READ,
32 GRPC_STATS_COUNTER_SYSCALL_POLL,
33 GRPC_STATS_COUNTER_SYSCALL_WAIT,
Craig Tiller640dfe42017-08-30 13:34:49 -070034 GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS,
Craig Tiller28086682017-07-18 14:22:19 -070035 GRPC_STATS_COUNTER_COUNT
36} grpc_stats_counters;
Craig Tiller640dfe42017-08-30 13:34:49 -070037extern const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT];
Craig Tiller33aeaba2017-07-20 16:02:24 -070038typedef enum {
39 GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE,
Craig Tiller640dfe42017-08-30 13:34:49 -070040 GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE,
Craig Tiller33aeaba2017-07-20 16:02:24 -070041 GRPC_STATS_HISTOGRAM_TCP_READ_SIZE,
Craig Tiller33aeaba2017-07-20 16:02:24 -070042 GRPC_STATS_HISTOGRAM_COUNT
43} grpc_stats_histograms;
Craig Tiller640dfe42017-08-30 13:34:49 -070044extern const char *grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT];
45typedef enum {
46 GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE_FIRST_SLOT = 0,
47 GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE_BUCKETS = 64,
48 GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE_FIRST_SLOT = 64,
49 GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE_BUCKETS = 64,
50 GRPC_STATS_HISTOGRAM_TCP_READ_SIZE_FIRST_SLOT = 128,
51 GRPC_STATS_HISTOGRAM_TCP_READ_SIZE_BUCKETS = 64,
Craig Tillerd1107832017-08-30 13:37:13 -070052 GRPC_STATS_HISTOGRAM_BUCKETS = 192
Craig Tiller640dfe42017-08-30 13:34:49 -070053} grpc_stats_histogram_constants;
54#define GRPC_STATS_INC_CLIENT_CALLS_CREATED(exec_ctx) \
55 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED)
56#define GRPC_STATS_INC_SERVER_CALLS_CREATED(exec_ctx) \
57 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SERVER_CALLS_CREATED)
58#define GRPC_STATS_INC_SYSCALL_WRITE(exec_ctx) \
59 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_WRITE)
60#define GRPC_STATS_INC_SYSCALL_READ(exec_ctx) \
61 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_READ)
62#define GRPC_STATS_INC_SYSCALL_POLL(exec_ctx) \
63 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_POLL)
64#define GRPC_STATS_INC_SYSCALL_WAIT(exec_ctx) \
65 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_WAIT)
66#define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS(exec_ctx) \
67 GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS)
Craig Tiller97ec5eb2017-09-01 12:57:36 -070068#define GRPC_STATS_INC_TCP_WRITE_SIZE(exec_ctx, value) \
69 grpc_stats_inc_tcp_write_size((exec_ctx), (double)(value))
70void grpc_stats_inc_tcp_write_size(grpc_exec_ctx *exec_ctx, double x);
71#define GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(exec_ctx, value) \
72 grpc_stats_inc_tcp_write_iov_size((exec_ctx), (double)(value))
73void grpc_stats_inc_tcp_write_iov_size(grpc_exec_ctx *exec_ctx, double x);
74#define GRPC_STATS_INC_TCP_READ_SIZE(exec_ctx, value) \
75 grpc_stats_inc_tcp_read_size((exec_ctx), (double)(value))
76void grpc_stats_inc_tcp_read_size(grpc_exec_ctx *exec_ctx, double x);
Craig Tillerd1107832017-08-30 13:37:13 -070077extern const int grpc_stats_histo_buckets[3];
78extern const int grpc_stats_histo_start[3];
79extern const double *const grpc_stats_histo_bucket_boundaries[3];
Craig Tiller97ec5eb2017-09-01 12:57:36 -070080extern void (*const grpc_stats_inc_histogram[3])(grpc_exec_ctx *exec_ctx,
81 double x);
Craig Tiller28086682017-07-18 14:22:19 -070082
83#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */