コード例 #1
0
ファイル: views.py プロジェクト: cavisson/analytics2.0
def home():
    rel = q.get_latest_release(src='performance')
    results = q.get_performance_data(release=rel, order_by=True).limit(5)
    cps = []
    hps = []
    throughput = []
    build = []
    for row in results:
         build_name, perf = row
         build.append(dict(name=build_name))
         cps.append(dict(cps=perf.cps))
         hps.append(dict(hps=perf.hps))
         throughput.append(dict(throughput=perf.throughput))
    
    rel = q.get_latest_release(src='testcase')
    smoke_results = q.dashboard_results(category="smoke", release=rel)
    reg_results = q.dashboard_results(category="regression", release=rel)

    build.reverse()
    cps.reverse()
    hps.reverse()
    throughput.reverse()
    smoke_results.reverse()
    reg_results.reverse()
    

    data = q.nav_tree_as_json()
    return render_template('dashboard/dashboard.html',
            build=build, cps=cps, hps=hps, 
            throughput=throughput,  
            smoke_results=smoke_results,
            reg_results=reg_results,data=data, release_name=rel, all_releases=q.get_all_release())
コード例 #2
0
ファイル: views.py プロジェクト: cavisson/analytics2.0
def get():
   release = request.args['release'].encode('utf-8')
   limit = request.args['limit'].encode('utf-8')

   stats = q.get_performance_data(release=release, order_by=True).limit(limit)
   smoke_stats = q.dashboard_results(category="smoke", release=release, limit=limit)
   reg_stats = q.dashboard_results(category="regression", release=release, limit=limit)
   smoke = parse_stats(smoke_stats) 
   reg = parse_stats(reg_stats) 
   cps, hps, throughput, builds = [], [], [], []
   for stat in stats:
       build, perf_metric = stat
       builds.append(build)
       cps.append(perf_metric.cps)
       hps.append(perf_metric.hps)
       throughput.append(perf_metric.throughput)

   builds.reverse()
   cps.reverse()
   hps.reverse()
   throughput.reverse()
   result = {
       'builds': builds,
       'cps': cps,
       'hps': hps,
       'throughput': throughput,
       'smoke': smoke,
       'reg': reg
   }
   
   return json.dumps(result)