Пример #1
0
def gather_cpu_data():
    print 'Collecting CPU data...'
    cpu_loads = get_cpu_stats(app.config['CPU_SAMPLER_TIME'])
    cs = CpuStats(cpu_loads)
    db.session.add(cs)
    db.session.commit()
    db.session.flush()
def gather_cpu_data():
    print 'Collecting CPU data...'
    cpu_loads = get_cpu_stats(app.config['CPU_SAMPLER_TIME'])
    cs = CpuStats(cpu_loads)
    db.session.add(cs)
    db.session.commit()
    db.session.flush()
Пример #3
0
def hello():
    our_response = render_template(
        'show_stats.html', 
        cpu_data=enumerate(get_cpu_stats()),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
    )

    return our_response
Пример #4
0
def hello():
    our_response = render_template(
        'show_stats.html',
        cpu_data=enumerate(get_cpu_stats()),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
    )

    return our_response
Пример #5
0
def hello():
    our_response = render_template(
        'show_stats.html', 
        cpu_data=enumerate(get_cpu_stats(
            app.config['CPU_SAMPLER_TIME'])),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
        cpu_history=(

            CpuStats.query.order_by(
                CpuStats.created.desc()
            ).limit(50)
            
        ),
    )

    return our_response