From 07dad29e258c229e810a449ac0d6ba4d9fc7e1d6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 5 May 2013 18:04:18 -0700 Subject: query: print something if theres no counts --- python/gras/query/chart_allocator_counts.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'python/gras') diff --git a/python/gras/query/chart_allocator_counts.js b/python/gras/query/chart_allocator_counts.js index cc06d24..5219672 100644 --- a/python/gras/query/chart_allocator_counts.js +++ b/python/gras/query/chart_allocator_counts.js @@ -35,12 +35,18 @@ GrasChartAllocatorCounts.prototype.update = function(point) ['Malloc\'d', 'times', 'allocation_count'], ]; + var entries = 0; $.each(stuff, function(contents_i, contents) { var dir = contents[0]; var units = contents[1]; var key = contents[2]; var count = (key in point)? point[key] : 0; - if (count > 0) make_entry(dir, count.toString() + ' ' + units); + if (count > 0) + { + make_entry(dir, count.toString() + ' ' + units); + entries++; + } }); + if (entries == 0) make_entry("Counts", "none"); } -- cgit