aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-09-12 15:16:33 -0700
committerGravatar GitHub <noreply@github.com>2017-09-12 15:16:33 -0700
commit6d4c993289875b04b35c32bcf854cf2013305ecc (patch)
tree34c7e76be58ea14910a69b8878750e81a48e57d4 /tools
parentd71880375506002818de17f74a5d4fd1571cdec7 (diff)
parent4b7fe94a9728686065a0cd4275ca64e24dc32c3c (diff)
Merge pull request #12487 from ctiller/stats_schema
Automatically generate BigQuery schema details for all counters
Diffstat (limited to 'tools')
-rwxr-xr-xtools/codegen/core/gen_stats_data.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py
index 8e4ef594af..cb01321ed3 100755
--- a/tools/codegen/core/gen_stats_data.py
+++ b/tools/codegen/core/gen_stats_data.py
@@ -313,3 +313,9 @@ with open('src/core/lib/debug/stats_data.c', 'w') as C:
len(inst_map['Histogram']), ','.join('grpc_stats_table_%d' % x for x in histo_bucket_boundaries))
print >>C, "void (*const grpc_stats_inc_histogram[%d])(grpc_exec_ctx *exec_ctx, int x) = {%s};" % (
len(inst_map['Histogram']), ','.join('grpc_stats_inc_%s' % histogram.name.lower() for histogram in inst_map['Histogram']))
+
+with open('src/core/lib/debug/stats_data_bq_schema.sql', 'w') as S:
+ columns = []
+ for counter in inst_map['Counter']:
+ columns.append(('%s_per_iteration' % counter.name, 'INTEGER'))
+ print >>S, ',\n'.join('%s:%s' % x for x in columns)