推荐学习书目
› 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 ·
    PRO
    · Oct 20, 2022 · 2412 views
    This topic created in 1486 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
    gumupaier
    Oct 24, 2022
    1
    自己写个 middleware 吧
    datadump
    datadump
    OP
    PRO
    Oct 24, 2022
    2
    @gumupaier 暂时搁置吧,反正是公司的项目能跑起来了。python 没啥熟练度,造轮子耗时~
    谢谢了
    wingor2015
    wingor2015
    Oct 26, 2022
    3
    要求不高的话,直接把 nginx 日志拿出来统计最简单,统计 cpu 、内存那些脚本网上很多
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1666 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:48 · PVG 08:48 · LAX 16:48 · JFK 19:48
    ♥ Do have faith in what you're doing.