推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
datadump
V2EX  ›  Python

请教 Python 接口统计

  •  
  •   datadump · Oct 20, 2022 · 2094 views
    This topic created in 1314 days ago, the information mentioned may be changed or developed.
    是个 fastapi (类似 flash )的 restful 服务程序,接口不是很多,调用也不频繁。

    没怎么写过 python ,算是边看书编写的模块吧。

    有木有这样的功能:加个装饰器或者类似的,对接口调用次数(最近 5 分钟,平均 3 分钟,平均 5 分钟,程序 cpu 内存负载)等之类的做个统计,然后提供 http://xxxx.com/status 返回统计信息( json 格式)

    不想造轮子,感谢大家
    3 replies    2022-10-26 16:07:30 +08:00
    gumupaier
        1
    gumupaier  
       Oct 24, 2022
    自己写个 middleware 吧
    datadump
        2
    datadump  
    OP
       Oct 24, 2022
    @gumupaier 暂时搁置吧,反正是公司的项目能跑起来了。python 没啥熟练度,造轮子耗时~
    谢谢了
    wingor2015
        3
    wingor2015  
       Oct 26, 2022
    要求不高的话,直接把 nginx 日志拿出来统计最简单,统计 cpu 、内存那些脚本网上很多
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1306 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 17:24 · PVG 01:24 · LAX 10:24 · JFK 13:24
    ♥ Do have faith in what you're doing.