aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/codegen/core/gen_stats_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/codegen/core/gen_stats_data.py')
-rwxr-xr-xtools/codegen/core/gen_stats_data.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py
index 93f2035c45..5c9d9e5ea5 100755
--- a/tools/codegen/core/gen_stats_data.py
+++ b/tools/codegen/core/gen_stats_data.py
@@ -28,8 +28,8 @@ REQUIRED_FIELDS = ['name', 'doc']
def make_type(name, fields):
- return (collections.namedtuple(
- name, ' '.join(list(set(REQUIRED_FIELDS + fields)))), [])
+ return (collections.namedtuple(name, ' '.join(
+ list(set(REQUIRED_FIELDS + fields)))), [])
def c_str(s, encoding='ascii'):
@@ -44,7 +44,10 @@ def c_str(s, encoding='ascii'):
return '"' + result + '"'
-types = (make_type('Counter', []), make_type('Histogram', ['max', 'buckets']),)
+types = (
+ make_type('Counter', []),
+ make_type('Histogram', ['max', 'buckets']),
+)
inst_map = dict((t[0].__name__, t[1]) for t in types)
@@ -349,8 +352,8 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C:
print >> C, "const int grpc_stats_histo_start[%d] = {%s};" % (
len(inst_map['Histogram']), ','.join('%s' % x for x in histo_start))
print >> C, "const int *const grpc_stats_histo_bucket_boundaries[%d] = {%s};" % (
- len(inst_map['Histogram']), ','.join('grpc_stats_table_%d' % x
- for x in histo_bucket_boundaries))
+ 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])(int x) = {%s};" % (
len(inst_map['Histogram']), ','.join(
'grpc_stats_inc_%s' % histogram.name.lower()