From 4b7fe94a9728686065a0cd4275ca64e24dc32c3c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 11 Sep 2017 13:30:13 -0700 Subject: Automatically generate BigQuery schema details for all counters --- tools/codegen/core/gen_stats_data.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/codegen/core/gen_stats_data.py') 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) -- cgit v1.2.3