int main(int argc, char *argv[]) { char buf[MAX] = {0}; int count = 0; while ((count = get_cmds(buf, MAX)) > 0) { #if DEBUG == 1 print_cmds(count); #endif run_cmds(buf); init_pipes(); } }
Response get_statist_info(Request& request) { std::vector<std::string> times; Json::Value root; Json::Value json_data; std::vector<std::string> cms = get_cmds(times); LOG_DEBUG("get cmds size:%d", cms.size()); send_commands(cms, times, json_data); Json::ArrayIndex index = 0; root["JSChart"]["datasets"][index]["type"] = "line"; root["JSChart"]["datasets"][index]["data"] = json_data; return Response(STATUS_OK, root); };