statistics:使用 PHP + Swoole 實現的統計監控系統(一)

說明

statistics是一個以swoole作爲服務器容器的統計監控系統。
statisitcs使用PHP開發,無需安裝Mysql等數據庫,無需安裝php-fpm等軟件。
statistics包含了客戶端和服務端,客戶端是一個類庫,通過函數調用的方式以UDP協議上報數據給服務端。
statistics服務端接收上報數據然後彙總展示。
statistics以曲線圖、餅圖和表格的方式展示請求量、耗時、成功率、錯誤日誌等。

依賴

PHP 5.3+
Swoole 1.7.18
Linux, OS X and basic Windows support

Swoole

安裝

參考:https://blog.csdn.net/Wss0130/article/details/104623187

Statistics

下載

如目錄:/data0/www/htdocs/

git clone https://github.com/smalleyes/statistics.git

修改配置

·配置文件位於:doc/statistics.conf
·複製文件statistics.conf到nginx(如:/usr/local/matrix/etc/virtualhost/)
·修改nginx配置(如:root   /data0/www/htdocs/statistics/Web)
·重啓nginx或重新加載nginx配置文件(如:/usr/local/matrix/sbin/tengine -s reload)
·配置hoshs文件,綁定ip域名對應關係(如:10.26.27.95 tongji.val.xyz)
·開啓守護進程模式:Config/Server.php的daemonize選項爲TRUE(配置信息都在Config目錄下)。

運行

·啓動swoole服務,php web.php與php worker.php
·打開瀏覽器訪問綁定的域名(如:http://tongji.val.xyz)
在這裏插入圖片描述
在這裏插入圖片描述

參考

http://www.itboth.com/d/EZZbyy/swoole-php
https://blog.csdn.net/Wss0130/article/details/104623187

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章