aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-06-29 08:33:05 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-07-01 08:18:35 +0000
commit5770c916c0cf110ced690ff128b065bbb2c827ca (patch)
tree2f15f301e4ef235cb3b77dc8c88e8a1eb879997a /src
parent01b0a05e4ffc9e84eeedf15919c1a320daec4e91 (diff)
papi: refactor set_errors_str
Assuming 2500 50 char lines: string_concat elapsed: 5.919933e-04 string_join elapsed: 2.830029e-04 string_concat size: 156,312,500 string_join size: 125,000 Type: refactor Change-Id: I0a400265426bde492e9a651d24996ddcfe954aa1 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_stats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 3638892135f..eeaa32d7229 100644
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -292,8 +292,8 @@ class VPPStats(object):
def set_errors_str(self):
'''Return all errors counters > 0 pretty printed'''
- s = 'ERRORS:\n'
+ s = ['ERRORS:']
error_counters = self.set_errors()
for k in sorted(error_counters):
- s += '{:<60}{:>10}\n'.format(k, error_counters[k])
- return s
+ s.append('{:<60}{:>10}'.format(k, error_counters[k]))
+ return '%s\n' % '\n'.join(s)