吐槽先,对于uWSGI状态信息没有文档说明这样一个现实,我只想说一句:F*CK YOU!!!

花了2天时间,累得眼珠子疼,针对这鬼畜的stats,借助Total Commander和VS大概撸了一边uWSGI的源码。还好C写的,不难。可是,尼玛一个文件几千行代码啊有木有有木有!!!!!FUCK YOU!!!到处return啊有木有!!!

好了心情好多了,;)

博客园代码格式里面没有json,哔...Python代替

Eclipse有个json插件,看起来可能会舒服一些

{
    "version":"2.0.7",
    "listen_queue":101,            //the maximum value of queues in sockets    master.c void master_check_listen_queue()
    "listen_queue_errors":0,    //unused    master_utils.c uwsgi_stats_keylong_comma(us, "listen_queue_errors", (unsigned long long) uwsgi.shared->backlog_errors)
    "signal_queue":0,            //length of master(worker0)'s signal queue
    "load":101,                    //same as listen_queue    master.c void master_check_listen_queue()
    "pid":13755,                //PID of master process
    "uid":500,
    "gid":500,
    "cwd":"/home/robert",
    "locks":[
        {
            "user 0":0            //uwsgi.lock(locknum=0) internal pointer    lock.c void uwsgi_setup_locking() uwsgi_pymodule.c PyObject *py_uwsgi_lock(PyObject * self, PyObject * args) uwsgi.c
        },
        {
            "signal":0            //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "filemon":0            //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "timer":0            //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "rbtimer":0            //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "cron":0            //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "rpc":0                //internal pointer    lock.c void uwsgi_setup_locking()
        },
        {
            "snmp":0            //internal pointer    uwsgi.c int uwsgi_start(void *v_argv)
        }
    ],
    "sockets":[
        {
            "name":":8080",
            "proto":"http",
            "queue":96,
            "max_queue":100,
            "shared":0,                    //If value was equal to 1,it's shared socket.    core/uwsgi.c void uwsgi_opt_add_shared_socket(char *opt, char *value, void *protocol) {"shared-socket", required_argument, 0, "create a shared socket for advanced jailing or ipc", uwsgi_opt_add_shared_socket, NULL, 0}
            "can_offload":0                //If value was equal to 1,there're some offload threads.    core/uwsgi.c uwsgi.offload_threads master_utils.c uwsgi_sock->can_offload
        },
        {
            "name":":8181",
            "proto":"http",
            "queue":101,
            "max_queue":100,
            "shared":0,
            "can_offload":0
        }
    ],
    "workers":[
        {
            "id":1,
            "pid":13756,
            "accepting":1,                    //mark the worker as "accepting" (this is a mark used by chain reloading)    core/uwsgi.c
            "requests":1314,                //number of closed resuests,summation of cores    utils.c void uwsgi_close_request(struct wsgi_request *wsgi_req)
            "delta_requests":1314,            //this is used for MAX_REQUESTS.if this worker been killed, this value will be reset    {"max-requests", required_argument, 'R', "reload workers after the specified amount of managed requests", uwsgi_opt_set_64bit, &uwsgi.max_requests, 0}
            "exceptions":7,                    //summation of core's exceptions    master_utils.c uint64_t uwsgi_worker_exceptions(int wid)
            "harakiri_count":0,                //harakiri count    master_utils.c void trigger_harakiri(int i) master.c uwsgi_master_check_workers_deadline()
            "signals":0,                    //number of signals receive    uwsgi.register_signal(num, who, function) signal.c int uwsgi_signal_handler(uint8_t sig)
            "signal_queue":0,                //length of signal queue
            "status":"busy",                //"cheap" "pause" "sigxx" "busy" "idle"    master_utils.c struct uwsgi_stats *uwsgi_master_generate_stats()
            "rss":10108928,                    //in bytes
            "vsz":176484352,                //in bytes
            "running_time":155985031,        //in microseconds    utils.c void uwsgi_close_request(struct wsgi_request *wsgi_req)
            "last_spawn":1412754993,        //spawned time in seconds since 1970-1-1 00:00:00    core/uwsgi.c uwsgi_start(void *v_argv)
            "respawn_count":1,
            "tx":3597862127,                //in bytes
            "avg_rt":125073,                //average response time in microseconds    utils.c uwsgi.workers[uwsgi.mywid].avg_response_time = (uwsgi.workers[uwsgi.mywid].avg_response_time + tmp_rt) / 2;
            "apps":[
                {
                    "id":0,
                    "modifier1":0,            //utils.c struct uwsgi_app *uwsgi_add_app(int id, uint8_t modifier1, char *mountpoint, int mountpoint_len, void *interpreter, void *callable)
                    "mountpoint":"",        //utils.c struct uwsgi_app *uwsgi_add_app(int id, uint8_t modifier1, char *mountpoint, int mountpoint_len, void *interpreter, void *callable)
                    "startup_time":0,        //total time in seconds during startup    pyloader.c wi->startup_time = uwsgi_now() - now; uwsgi_log( "WSGI app %d (mountpoint='%.*s') ready in %d seconds on interpreter %p pid: %d%s\n", id, wi->mountpoint_len, wi->mountpoint, (int) wi->startup_time, wi->interpreter, (int) getpid(), default_app);
                    "requests":1315,        //python/wsgi_handlers.c int uwsgi_request_wsgi(struct wsgi_request *wsgi_req)
                    "exceptions":7,
                    "chdir":""                //change work directory
                }
            ],
            "cores":[
                {
                    "id":0,
                    "requests":1314,        //utils.c uwsgi.workers[uwsgi.mywid].cores[wsgi_req->async_id].requests++;
                    "static_requests":0,    //static file serving mode    static.c int uwsgi_file_serve(...) uwsgi_real_file_serve(struct wsgi_request *wsgi_req, char *real_filename, size_t real_filename_len, struct stat *st)
                    "routed_requests":0,    //route mode    routing.c int uwsgi_apply_routes_do(struct uwsgi_route *routes, struct wsgi_request *wsgi_req, char *subject, uint16_t subject_len)
                    "offloaded_requests":0,    //offload.c int uwsgi_offload_enqueue(struct wsgi_request *wsgi_req, struct uwsgi_offload_request *uor)
                    "write_errors":14,
                    "read_errors":0,
                    "in_request":1,            //if 1,dealing with request,else 0    utils.c void uwsgi_close_request(struct wsgi_request *wsgi_req) int wsgi_req_async_recv(struct wsgi_request *wsgi_req)
                    "vars":[
"REQUEST_METHOD=GET",
"REQUEST_URI=/",
"PATH_INFO=/",
"QUERY_STRING=",
"SERVER_PROTOCOL=HTTP/1.1",
"SCRIPT_NAME=",
"SERVER_NAME=localhost.localdomain",
"SERVER_PORT=8080",
"REMOTE_ADDR=10.30.178.33",
"HTTP_ACCEPT_ENCODING=identity",
"HTTP_HOST=10.30.178.174:8080",
"HTTP_CONNECTION=close",
"HTTP_USER_AGENT=Python-urllib/2.7",
""
                    ]
                }
            ]
        },
        {
            "id":2,
            "pid":13757,
            "accepting":1,
            "requests":1495,
            "delta_requests":1495,
            "exceptions":34,
            "harakiri_count":0,
            "signals":0,
            "signal_queue":0,
            "status":"busy",
            "rss":10104832,
            "vsz":176484352,
            "running_time":156051340,
            "last_spawn":1412754993,
            "respawn_count":1,
            "tx":3548600500,
            "avg_rt":19505,
            "apps":[
                {
                    "id":0,
                    "modifier1":0,
                    "mountpoint":"",
                    "startup_time":0,
                    "requests":1496,
                    "exceptions":34,
                    "chdir":""
                }
            ],
            "cores":[
                {
                    "id":0,
                    "requests":1495,
                    "static_requests":0,
                    "routed_requests":0,
                    "offloaded_requests":0,
                    "write_errors":62,
                    "read_errors":0,
                    "in_request":1,
                    "vars":[
"REQUEST_METHOD=GET",
"REQUEST_URI=/",
"PATH_INFO=/",
"QUERY_STRING=",
"SERVER_PROTOCOL=HTTP/1.1",
"SCRIPT_NAME=",
"SERVER_NAME=localhost.localdomain",
"SERVER_PORT=8080",
"REMOTE_ADDR=10.30.178.33",
"HTTP_ACCEPT_ENCODING=identity",
"HTTP_HOST=10.30.178.174:8080",
"HTTP_CONNECTION=close",
"HTTP_USER_AGENT=Python-urllib/2.7",
""
                    ]
                }
            ]
        },
        {
            "id":3,
            "pid":13758,
            "accepting":1,
            "requests":1284,
            "delta_requests":1284,
            "exceptions":7,
            "harakiri_count":0,
            "signals":0,
            "signal_queue":0,
            "status":"busy",
            "rss":10104832,
            "vsz":176484352,
            "running_time":156205643,
            "last_spawn":1412754993,
            "respawn_count":1,
            "tx":3636193672,
            "avg_rt":2959,
            "apps":[
                {
                    "id":0,
                    "modifier1":0,
                    "mountpoint":"",
                    "startup_time":0,
                    "requests":1285,
                    "exceptions":7,
                    "chdir":""
                }
            ],
            "cores":[
                {
                    "id":0,
                    "requests":1284,
                    "static_requests":0,
                    "routed_requests":0,
                    "offloaded_requests":0,
                    "write_errors":12,
                    "read_errors":0,
                    "in_request":1,
                    "vars":[
"REQUEST_METHOD=GET",
"REQUEST_URI=/",
"PATH_INFO=/",
"QUERY_STRING=",
"SERVER_PROTOCOL=HTTP/1.1",
"SCRIPT_NAME=",
"SERVER_NAME=localhost.localdomain",
"SERVER_PORT=8080",
"REMOTE_ADDR=10.30.178.33",
"HTTP_ACCEPT_ENCODING=identity",
"HTTP_HOST=10.30.178.174:8080",
"HTTP_CONNECTION=close",
"HTTP_USER_AGENT=Python-urllib/2.7",
""
                    ]
                }
            ]
        },
        {
            "id":4,
            "pid":13759,
            "accepting":1,
            "requests":1332,
            "delta_requests":1332,
            "exceptions":10,
            "harakiri_count":0,
            "signals":0,
            "signal_queue":0,
            "status":"busy",
            "rss":10108928,
            "vsz":176484352,
            "running_time":151715232,
            "last_spawn":1412754993,
            "respawn_count":1,
            "tx":3439073176,
            "avg_rt":19619,
            "apps":[
                {
                    "id":0,
                    "modifier1":0,
                    "mountpoint":"",
                    "startup_time":0,
                    "requests":1333,
                    "exceptions":10,
                    "chdir":""
                }
            ],
            "cores":[
                {
                    "id":0,
                    "requests":1332,
                    "static_requests":0,
                    "routed_requests":0,
                    "offloaded_requests":0,
                    "write_errors":15,
                    "read_errors":0,
                    "in_request":1,
                    "vars":[
"REQUEST_METHOD=GET",
"REQUEST_URI=/",
"PATH_INFO=/",
"QUERY_STRING=",
"SERVER_PROTOCOL=HTTP/1.1",
"SCRIPT_NAME=",
"SERVER_NAME=localhost.localdomain",
"SERVER_PORT=8080",
"REMOTE_ADDR=10.30.178.33",
"HTTP_ACCEPT_ENCODING=identity",
"HTTP_HOST=10.30.178.174:8080",
"HTTP_CONNECTION=close",
"HTTP_USER_AGENT=Python-urllib/2.7",
""
                    ]
                }
            ]
        }
    ]
}

uWSGI的stats注释,送给需要的人,欢迎指正的更多相关文章

  1. 成功的背后!(送给所有IT人)

    希望自己迷茫的时候,看到能够惊醒 来自CSDN第3名的博主(http://blog.csdn.net/phphot/article/details/2187505) 成功的背后,有着许多不为人知的故事 ...

  2. Journal of Proteome Research | SAAVpedia: identification, functional annotation, and retrieval of single amino acid variants for proteogenomic interpretation | SAAV的识别、功能注释和检索 | (解读人:徐洪凯)

    文献名:SAAVpedia: identification, functional annotation, and retrieval of single amino acid variants fo ...

  3. UWSGI配置文件---ini和xml示例

    一   conf.ini文件: [uwsgi] http = $(HOSTNAME):9033 http-keepalive = 1 pythonpath = ../ module = service ...

  4. 跨过Nginx上基于uWSGI部署Django项目的坑

    先说说他们的关系,Nginx和uWSGI都是Web服务器,Nginx负责静态内容,uWSGI负责Python这样的动态内容,二者配合共同提供Web服务以实现提高效率和负载均衡等目的.uWSGI实现了多 ...

  5. CentOS下实现Flask + Virtualenv + uWSGI + Nginx部署

    一.项目简介 在本文中,将一步一步搭建一个简单的Flask + Virtualenv + uWSGI + Nginx 架构的Web服务,可以作为新手的学习也可作为记录备忘. 如果你安装好了环境并有一定 ...

  6. nginx+uwsgi+flask

    说明:没用虚拟环境 安装nginx,并新建一个conf配置文件,启动nginx # xxx.conf server { listen 80; server_name localhost; locati ...

  7. VS中如何快捷地给自己的代码添加创建信息注释

    VS中如何快捷地给自己的代码添加创建信息注释 Intro 以下讨论的都是没有使用 GIT 来管理源代码的情况,如果使用 GIT 管理源代码可直接使用VS的Git扩展就不需要考虑以下问题. 什么是创建信 ...

  8. 配置TortoiseSVN客户端, 强制签入前加注释

    正如上篇提到, 总有一些人在签入代码到SVN前没有加注释, 然后, 像这样: 鬼才知道改了什么东西. ①有些人可能就是没有写注释的习惯, ②有些人可能是忘记写注释 && SVN服务端和 ...

  9. java注释规范

    前言:      现在java的出产地sun公司并没有定义一个java注释规范,注释规范目前是每个公司自己有自己的一套规范,主要是为了团队之间的协作. 1.基本规则      1.注释应该使代码更加清 ...

随机推荐

  1. Android仿掌上英雄联盟首页,实现折叠效果

    概述 仿掌上英雄联盟首页的demo 详细 代码下载:http://www.demodashi.com/demo/10695.html 首页大概分为几个部分 状态栏 标题栏 轮播图 切换的Tab 资讯列 ...

  2. 创建 StyledMapType 地图样式

    您可以通过创建 StyledMapType 并向构造函数传递特征和样式器信息,新建作为样式应用对象的地图类型.此方法不会影响默认地图类型的样式. 如需新建地图类型: 创建您的样式数组.请参阅“地图特征 ...

  3. 从使用 KVO 监听 readonly 属性说起

    01.KVO 原理 KVO 是 key-value observing 的简写,它的原理大致是: 1.当一个 object(对象) 有观察者时候,动态创建这个 object(对象) 的类的子类(以 N ...

  4. OAF_OAF组件系列1 - Item Style汇总(概念)

    20150506 Created By BaoXinjian

  5. tmux安装

    安装tmux sudo yum -y install tmux 修改tmux配置 cat > /root/.tmux.conf <<EOF set-option -g default ...

  6. MYSQL 更改数据库data存储目录 创建用户 创建权限 设置远程访问的权限.

    一. 怎么更改数据库data存储目录:  1. 安装MYSQL. 2. 切换到 C:\Program Files\MySQL\MySQL Server 5.6 3. 新建my.ini. 加入如下配置: ...

  7. 请教中文的OCR软件哪个最好?

    对原件,有这几种:1,全中文(含标点,一些英文符号)2,中英文(英文较多,或英文占大多数)3,全英文(这个用finereader8.0) 針對1.2 紫光 超星阅读器自带的OCR组件 尚书七号搞定全中 ...

  8. navicat 在写存储过程的时候总是说语法错误

    这个时候我们在sql的头部加上 DELIMITER $$ 尾部加上 $$DELIMITER;

  9. Javascript玩转继承(三)

    在前两篇文章中,介绍了构造继承和原型继承.今天把剩下的两种写完,这两种的应用相对于前两种来说应用很少,因此称为是非主流继承方式. 首先,来看非主流继承一:实例继承法.我也不说那么多废话了,既然是非主流 ...

  10. modelsim常见错误

    1. Error: (vlog-7) Failed to open design unit file "D:/Xilinx/verilog/src/glbl.v" in read ...