Commit c4f21512 authored by Alan Mitchell's avatar Alan Mitchell
Browse files

Added Load and DB Size info to Report Results

To get server info for performance testing recording.
parent 8576c661
# Create your views here.
import sys, logging, json, random, time
import os
import subprocess
from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect
......@@ -86,6 +88,12 @@ def get_report_results(request):
# Make the chart object
chart_obj = basechart.get_chart_object(request.GET)
result = chart_obj.result()
# add some info about load and size of the database
dbsize = os.path.getsize(chart_obj.reading_db.db_fname)
loads = subprocess.check_output('uptime').split(':')[-1].split(',')
loads = [float(ld) for ld in loads]
result['objects'] = result['objects'].append( ('stats', {'dbsize': dbsize, 'loads': loads}) )
except:
_logger.exception('Error in get_report_results')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment