入门指引 Server Client Process AsyncIO Memory HttpServer WebSocket 高级 其他

发布于 2015-08-09 09:37:33 | 156 次阅读 | 评论: 0 | 来源: 网络整理

得到当前Server的活动TCP连接数,启动时间,accpet/close的总次数等信息。

array swoole_server->stats();

返回的结果数组示例:

array (
  'start_time' => 1409831644,
  'connection_num' => 1,
  'accept_count' => 1,
  'close_count' => 0,
);
  • start_time 服务器启动的时间
  • connection_num 当前连接的数量
  • accept_count 接受了多少个连接
  • close_count 关闭的连接数量
  • tasking_num 当前正在排队的任务数

stats()方法在1.7.5+后可用

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务