diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/gras/query/CMakeLists.txt | 1 | ||||
-rw-r--r-- | python/gras/query/chart_allocator_counts.js | 46 | ||||
-rw-r--r-- | python/gras/query/chart_factory.js | 1 | ||||
-rw-r--r-- | python/gras/query/main.html | 1 |
4 files changed, 49 insertions, 0 deletions
diff --git a/python/gras/query/CMakeLists.txt b/python/gras/query/CMakeLists.txt index ab49532..a448068 100644 --- a/python/gras/query/CMakeLists.txt +++ b/python/gras/query/CMakeLists.txt @@ -20,6 +20,7 @@ INSTALL( chart_overall_throughput.js chart_handler_breakdown.js chart_total_io_counts.js + chart_allocator_counts.js main.css DESTINATION ${GR_PYTHON_DIR}/gras/query COMPONENT ${GRAS_COMP_PYTHON} diff --git a/python/gras/query/chart_allocator_counts.js b/python/gras/query/chart_allocator_counts.js new file mode 100644 index 0000000..cc06d24 --- /dev/null +++ b/python/gras/query/chart_allocator_counts.js @@ -0,0 +1,46 @@ +function GrasChartAllocatorCounts(args, panel) +{ + //input checking + if (args.block_ids.length != 0) throw gras_error_dialog( + "GrasChartAllocatorCounts", + "Error making allocator counts chart.\n"+ + "Do not specify any blocks for this chart." + ); + + //settings + this.div = $('<div />').attr({class:'chart_total_io_counts'}); + $(panel).append(this.div); + this.title = "Theron allocator counts" +} + +GrasChartAllocatorCounts.prototype.update = function(point) +{ + var ul = $('<ul />'); + $('ul', this.div).remove(); //clear old lists + this.div.append(ul); + + function make_entry(strong, span) + { + var li = $('<li />'); + var strong = $('<strong />').text(strong + ": "); + var span = $('<span />').text(span); + li.append(strong); + li.append(span); + ul.append(li); + } + + var stuff = [ + ['Allocated', 'bytes', 'bytes_allocated'], + ['Peak size', 'bytes', 'peak_bytes_allocated'], + ['Malloc\'d', 'times', 'allocation_count'], + ]; + + $.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); + }); +} diff --git a/python/gras/query/chart_factory.js b/python/gras/query/chart_factory.js index 122d222..dbb141a 100644 --- a/python/gras/query/chart_factory.js +++ b/python/gras/query/chart_factory.js @@ -13,6 +13,7 @@ var gras_chart_get_registry = function() {key:'overall_throughput', name:'Overall Throughput', factory:GrasChartOverallThroughput}, {key:'handler_breakdown', name:'Handler Breakdown', factory:GrasChartHandlerBreakdown}, {key:'total_io_counts', name:'I/O port Totals', factory:GrasChartTotalIoCounts}, + {key:'allocator_counts', name:'Allocator Counts', factory:GrasChartAllocatorCounts}, ]; } diff --git a/python/gras/query/main.html b/python/gras/query/main.html index b64d53f..64d5809 100644 --- a/python/gras/query/main.html +++ b/python/gras/query/main.html @@ -15,6 +15,7 @@ <script type="text/javascript" src="/chart_overall_throughput.js"></script> <script type="text/javascript" src="/chart_handler_breakdown.js"></script> <script type="text/javascript" src="/chart_total_io_counts.js"></script> + <script type="text/javascript" src="/chart_allocator_counts.js"></script> <script type="text/javascript" src="/main.js"></script> <script type="text/javascript"> google.load('visualization', '1.0', {'packages':['corechart']}); |