diff options
author | Craig Tiller <ctiller@google.com> | 2017-09-11 13:30:13 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-09-11 13:30:13 -0700 |
commit | 4b7fe94a9728686065a0cd4275ca64e24dc32c3c (patch) | |
tree | 74667b80b22f62c490d714be08ad90727dec4e87 /tools/codegen/core/gen_stats_data.py | |
parent | e29d497fa90506e9e09f2d66536052454acf3a6e (diff) |
Automatically generate BigQuery schema details for all counters
Diffstat (limited to 'tools/codegen/core/gen_stats_data.py')
-rwxr-xr-x | tools/codegen/core/gen_stats_data.py | 6 |
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) |