aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/debug/stats_data.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-08-30 13:34:49 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-08-30 13:34:49 -0700
commit640dfe499edd8e8f4fb2c106886e421dde22b638 (patch)
treef5118c5b16bbbe8798a316b96840887db1f481a8 /src/core/lib/debug/stats_data.c
parente944c5d4907732b2bc0a9c6e355ff1e6a65b37e2 (diff)
Histogram support
Diffstat (limited to 'src/core/lib/debug/stats_data.c')
-rw-r--r--src/core/lib/debug/stats_data.c308
1 files changed, 299 insertions, 9 deletions
diff --git a/src/core/lib/debug/stats_data.c b/src/core/lib/debug/stats_data.c
index 2cd6a9f130..b137f1fe65 100644
--- a/src/core/lib/debug/stats_data.c
+++ b/src/core/lib/debug/stats_data.c
@@ -1,12 +1,12 @@
/*
* Copyright 2017 gRPC authors.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,10 +20,300 @@
#include "src/core/lib/debug/stats_data.h"
const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
- "client_calls_created",
- "server_calls_created",
- "syscall_write",
- "syscall_read",
- "syscall_poll",
- "syscall_wait",
+ "client_calls_created", "server_calls_created", "syscall_write",
+ "syscall_read", "syscall_poll", "syscall_wait",
+ "histogram_slow_lookups",
};
+const char *grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT] = {
+ "tcp_write_size", "tcp_write_iov_size", "tcp_read_size", "client_latency",
+};
+const double grpc_stats_table_0[64] = {0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5.17974600698,
+ 6.70744217421,
+ 8.68571170472,
+ 11.2474451301,
+ 14.5647272503,
+ 18.8603969544,
+ 24.4230164536,
+ 31.6262554885,
+ 40.9539926456,
+ 53.032819969,
+ 68.6741343683,
+ 88.9286433193,
+ 115.156946285,
+ 149.120933174,
+ 193.102139541,
+ 250.055009057,
+ 323.805358672,
+ 419.307378404,
+ 542.976429747,
+ 703.119998467,
+ 910.495751121,
+ 1179.03418281,
+ 1526.77440013,
+ 1977.07590065,
+ 2560.18775048,
+ 3315.28056941,
+ 4293.07782286,
+ 5559.26317765,
+ 7198.89281155,
+ 9322.10907382,
+ 12071.5393129,
+ 15631.8768886,
+ 20242.2879738,
+ 26212.4775761,
+ 33943.4940145,
+ 43954.6693961,
+ 56918.5058232,
+ 73705.8508152,
+ 95444.3966128,
+ 123594.433061,
+ 160046.942783,
+ 207250.628202,
+ 268376.403469,
+ 347530.401059,
+ 450029.801797,
+ 582760.01722,
+ 754637.218056,
+ 977207.279236,
+ 1265421.37565,
+ 1638640.32942,
+ 2121935.1758,
+ 2747771.31348,
+ 3558189.37227,
+ 4607629.29828,
+ 5966587.36485,
+ 7726351.7696,
+ 10005134.9318,
+ 12956014.428,
+ 16777216.0};
+const uint8_t grpc_stats_table_1[87] = {
+ 0, 1, 3, 3, 4, 6, 6, 7, 9, 9, 10, 12, 12, 13, 15, 15, 16, 18,
+ 18, 19, 21, 21, 22, 24, 24, 25, 27, 27, 28, 30, 30, 31, 32, 34, 34, 36,
+ 36, 37, 39, 39, 40, 42, 42, 43, 44, 46, 46, 47, 49, 49, 51, 51, 52, 53,
+ 55, 55, 56, 58, 58, 59, 61, 61, 63, 63, 64, 65, 67, 67, 68, 70, 70, 71,
+ 73, 73, 75, 75, 76, 77, 79, 79, 80, 82, 82, 83, 85, 85, 87};
+const double grpc_stats_table_2[64] = {0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12.0020736244,
+ 13.0954337532,
+ 14.2883963681,
+ 15.5900350167,
+ 17.0102498252,
+ 18.5598427974,
+ 20.2505999737,
+ 22.0953810747,
+ 24.1082173107,
+ 26.3044181014,
+ 28.7006875181,
+ 31.315251333,
+ 34.1679956422,
+ 37.2806181177,
+ 40.6767930374,
+ 44.3823513489,
+ 48.4254771375,
+ 52.8369219909,
+ 57.6502388927,
+ 62.902037423,
+ 68.6322622068,
+ 74.8844967285,
+ 81.7062948236,
+ 89.1495423679,
+ 97.2708519163,
+ 106.131993291,
+ 115.800363399,
+ 126.34949884,
+ 137.859635225,
+ 150.418317437,
+ 164.121065485,
+ 179.072101023,
+ 195.38514005,
+ 213.184257818,
+ 232.604832535,
+ 253.794575043,
+ 276.914652285,
+ 302.140913126,
+ 329.665225843,
+ 359.696937452,
+ 392.464465978,
+ 428.217037783,
+ 467.226583154,
+ 509.78980457,
+ 556.230433401,
+ 606.901692163,
+ 662.1889811,
+ 722.512809492,
+ 788.331994007,
+ 860.147148411,
+ 938.504491184,
+ 1024.0};
+const uint8_t grpc_stats_table_3[52] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52};
+const double grpc_stats_table_4[128] = {0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6.04764436132,
+ 7.3148004642,
+ 8.8474623563,
+ 10.7012611662,
+ 12.9434843502,
+ 15.6555180292,
+ 18.9358010666,
+ 22.9033981095,
+ 27.7023212864,
+ 33.5067574247,
+ 40.5273905211,
+ 49.0190489527,
+ 59.2899549993,
+ 71.7129124069,
+ 86.7388380702,
+ 104.913128993,
+ 126.895458596,
+ 153.483720931,
+ 185.642991889,
+ 224.540558623,
+ 271.588288649,
+ 328.493876489,
+ 397.322827976,
+ 480.573432046,
+ 581.267441303,
+ 703.059752763,
+ 850.371069894,
+ 1028.54836117,
+ 1244.05893936,
+ 1504.72520595,
+ 1820.00858143,
+ 2201.352927,
+ 2662.59992325,
+ 3220.49148246,
+ 3895.27743092,
+ 4711.45051817,
+ 5698.63543198,
+ 6892.66408748,
+ 8336.87622063,
+ 10083.6924933,
+ 12196.5172097,
+ 14752.0397062,
+ 17843.0179495,
+ 21581.6453782,
+ 26103.6231959,
+ 31573.0859261,
+ 38188.5590141,
+ 46190.1647178,
+ 55868.3378408,
+ 67574.3676638,
+ 81733.1487144,
+ 98858.6031911,
+ 119572.334831,
+ 144626.191302,
+ 174929.554066,
+ 211582.346255,
+ 255914.956657,
+ 309536.528921,
+ 374393.36875,
+ 452839.589087,
+ 547722.557505,
+ 662486.247293,
+ 801296.243578,
+ 969190.941845,
+ 1172264.4269,
+ 1417887.67026,
+ 1714976.07481,
+ 2074313.07772,
+ 2508941.55762,
+ 3034637.25277,
+ 3670481.37407,
+ 4439553.19704,
+ 5369767.77177,
+ 6494889.15731,
+ 7855755.95793,
+ 9501763.64457,
+ 11492657.4655,
+ 13900701.0236,
+ 16813299.2328,
+ 20336170.86,
+ 24597185.8065,
+ 29751006.4094,
+ 35984701.2311,
+ 43524535.0988,
+ 52644181.8539,
+ 63674657.909,
+ 77016337.1725,
+ 93153483.4461,
+ 112671827.78,
+ 136279828.791,
+ 164834387.63,
+ 199371950.98,
+ 241146131.03,
+ 291673207.915,
+ 352787166.24,
+ 426706263.331,
+ 516113545.475,
+ 624254234.618,
+ 755053520.404,
+ 913259033.033,
+ 1104613168.31,
+ 1336061519.75,
+ 1616004983.26,
+ 1954604684.98,
+ 2364150800.34,
+ 2859508651.4,
+ 3458658274.36,
+ 4183347042.13,
+ 5059879030.16,
+ 6120069777.14,
+ 7402401095.72,
+ 8953417849.36,
+ 10829417394.2,
+ 13098493008.1,
+ 15843005476.5,
+ 19162572547.2,
+ 23177684762.8,
+ 28034078912.8,
+ 33908027852.3,
+ 41012738688.9,
+ 49606091574.9,
+ 60000000000.0};
+const uint16_t grpc_stats_table_5[265] = {
+ 0, 2, 2, 4, 4, 6, 6, 8, 8, 11, 11, 11, 13, 13, 15,
+ 15, 17, 17, 20, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30,
+ 30, 33, 33, 33, 35, 35, 37, 37, 39, 39, 42, 42, 42, 44, 44,
+ 46, 46, 48, 48, 51, 51, 51, 53, 53, 54, 57, 57, 57, 60, 60,
+ 60, 61, 63, 63, 66, 66, 66, 68, 68, 70, 70, 72, 72, 75, 75,
+ 75, 77, 77, 79, 79, 81, 81, 84, 84, 84, 85, 87, 87, 90, 90,
+ 90, 92, 92, 94, 94, 96, 96, 99, 99, 99, 101, 101, 103, 103, 105,
+ 105, 108, 108, 108, 109, 112, 112, 112, 114, 114, 116, 116, 118, 118, 120,
+ 120, 123, 123, 123, 125, 125, 127, 127, 129, 129, 132, 132, 132, 134, 134,
+ 136, 136, 138, 138, 140, 140, 142, 142, 145, 145, 145, 147, 147, 149, 149,
+ 151, 151, 154, 154, 154, 156, 156, 158, 158, 160, 160, 162, 162, 165, 165,
+ 165, 166, 169, 169, 169, 172, 172, 172, 173, 175, 175, 178, 178, 178, 180,
+ 180, 182, 182, 184, 184, 187, 187, 187, 189, 189, 191, 191, 193, 193, 196,
+ 196, 196, 197, 199, 199, 202, 202, 202, 204, 204, 206, 206, 208, 208, 211,
+ 211, 211, 213, 213, 215, 215, 217, 217, 220, 220, 220, 221, 224, 224, 224,
+ 226, 226, 228, 228, 230, 230, 232, 232, 235, 235, 235, 237, 237, 239, 239,
+ 241, 241, 244, 244, 244, 246, 246, 248, 248, 250, 250, 252, 252, 254, 254,
+ 257, 257, 257, 259, 259, 261, 261, 263, 263, 265};
+const int grpc_stats_histo_buckets[4] = {64, 64, 64, 128};
+const int grpc_stats_histo_start[4] = {0, 64, 128, 192};
+const double *const grpc_stats_histo_bucket_boundaries[4] = {
+ grpc_stats_table_0, grpc_stats_table_2, grpc_stats_table_0,
+ grpc_stats_table_4};