def background_timer_stuff_cputop(socketio, interval, socket_res_message_key,
                                  profiler_method):
    data = profiler_method()
    socketio.emit(socket_res_message_key, data)
    cpu_top_count = get_value("cputop")
    print("background_timer_stuff-" + str(cpu_top_count))
    if (cpu_top_count == "True"):
        Timer(interval, background_timer_stuff_cputop,
              [socketio, interval, socket_res_message_key, profiler_method
               ]).start()
    elif (cpu_top_count == "False"):
        print("cancel()")
def background_timer_stuff_perfflame(socketio, interval,
                                     socket_res_message_key, profiler_method):
    data = profiler_method()
    socketio.emit(socket_res_message_key, data)

    perf_flame_count = get_value("perfflame")
    print("background_timer_stuff-" + str(perf_flame_count))
    if (perf_flame_count == "True"):
        Timer(interval, background_timer_stuff_perfflame,
              [socketio, interval, socket_res_message_key, profiler_method
               ]).start()
    elif (perf_flame_count == "False"):
        print("cancel()")
def background_timer_stuff_iostatus(socketio, interval, socket_res_message_key,
                                    profiler_method):
    data = profiler_method()
    socketio.emit(socket_res_message_key, data)

    io_status_count = get_value("iostatus")
    print("background_timer_stuff-" + str(io_status_count))
    if (io_status_count == "True"):
        Timer(interval, background_timer_stuff_iostatus,
              [socketio, interval, socket_res_message_key, profiler_method
               ]).start()
    elif (io_status_count == "False"):
        print("cancel()")
def background_timer_stuff_cpumysql2(socketio, interval,
                                     socket_res_message_key, profiler_method,
                                     args):
    data = profiler_method(args)
    socketio.emit(socket_res_message_key, data)
    cpu_mysql_count2 = get_value("cpumysql2")
    print("background_timer_stuff-" + str(cpu_mysql_count2))
    if (cpu_mysql_count2 == "True"):
        Timer(interval, background_timer_stuff_cpumysql2, [
            socketio, interval, socket_res_message_key, profiler_method, args
        ]).start()
    elif (cpu_mysql_count2 == "False"):
        print("cancel()")
def background_timer_stuff_gprof_callgraph(socketio, interval,
                                           socket_res_message_key,
                                           profiler_method, args1):
    data = profiler_method(args1)
    socketio.emit(socket_res_message_key, data)

    gprof_count = get_value("gprof")
    print("background_timer_stuff-" + "gprof " + str(gprof_count))
    if (gprof_count == "True"):
        Timer(interval, background_timer_stuff_gprof_callgraph, [
            socketio, interval, socket_res_message_key, profiler_method, args1
        ]).start()
    elif (gprof_count == "False"):
        print("cancel()")
def background_timer_stuff_memoryprocrankpss(socketio, interval,
                                             socket_res_message_key,
                                             profiler_method):
    data = profiler_method()
    socketio.emit(socket_res_message_key, data)

    memory_procrankpss_count = get_value("memoryprocrankpss")
    print("background_timer_stuff-" + str(memory_procrankpss_count))
    if (memory_procrankpss_count == "True"):
        Timer(interval, background_timer_stuff_memoryprocrankpss,
              [socketio, interval, socket_res_message_key, profiler_method
               ]).start()
    elif (memory_procrankpss_count == "False"):
        print("cancel()")
def background_timer_stuff_cpustatusergroup(socketio, interval,
                                            socket_res_message_key,
                                            profiler_method, args):
    data = profiler_method(args)
    socketio.emit(socket_res_message_key, data)

    cpu_statusergroup_count = get_value("cpustatusergroup")
    print("background_timer_stuff-" + str(cpu_statusergroup_count))
    if (cpu_statusergroup_count == "True"):
        print("socketProcesor------")
        Timer(interval, background_timer_stuff_cpustatusergroup, [
            socketio, interval, socket_res_message_key, profiler_method, args
        ]).start()
    elif (cpu_statusergroup_count == "False"):
        print("cancel()")