django processinfo是一个django应用程序,用于收集有关正在运行的服务器进程的信息。

django-processinfo的Python项目详细描述


一个可重用的django应用程序,用于收集有关正在运行的服务器进程的信息。 我们尽量减少额外的开销:django processinfo大多数时候只创建一个数据库查询来更新数据。

django processinfo将捕获的最重要数据:

  • 过程统计:

    • process PID, start time, life times
    • Number of average/max living processes
    • min/average/max response times
    • Total request/exceptions count
  • 内存统计:

    • min/average/max memory usage (VmRSS, VmPeak)
  • 系统信息:

    • System memory usage
    • Swap usage
    • load average

django processinfo按站点id拆分这些数据中的一些,这样您就可以看到哪个站点最常用。

不是什么:

更多信息:https://www.python-forum.de/viewtopic.php?f=6&t=27168(de)

限制

只有当^ {STR 1 } $/PRO/$$/STATION/STATION存在时,这才有效。因此,只有在类似unix/linux的平台上。

待办事项

添加单元测试

屏幕截图

这里是some screenshots (from v0.2 - 19.08.2011)它的样子:


Screenshot 1


Screenshot 2

安装

  1. 安装,例如:
pip install django-processinfo
  1. 添加设置(见下文)
  2. 创建表(运行syncdb)

设置

将此添加到您的设置中。py:

import os

import django_processinfo


INSTALLED_APPS = (
    ...
    'django_processinfo',
    ...
)

MIDDLEWARE = (
    'django_processinfo.middlewares.ProcessInfoMiddleware',
    ...
)

# Put templates above admin contrib, e.g.:
TEMPLATE_DIRS = (
    ...
    os.path.join(os.path.abspath(os.path.dirname(django_processinfo.__file__)), "templates/"),
    ...
)

# include app settings from ./django_processinfo/app_settings.py
from django_processinfo import app_settings as PROCESSINFO

# Change settings like this:
PROCESSINFO.ADD_INFO = True

processinfomiddleware

processinfomiddleware实际上可以插入任何位置。 然而,它应该被添加到远高于。因此,捕捉一切。

为了提高性能,可以将processinfomiddleware放在localsynccachemiddleware之后。 但是,在每次缓存命中时都缺少统计值!

应用程序设置

可在./django_processinfo/app_settings.py中找到可用的django processinfo设置

django兼容性

VersionPythonDjango
v0.8.0python 3django v1.11 LTS
v0.7.0python 2django v1.5
v0.6.1python 2django v1.4

历史记录

  • dev-compare v0.7.1…master

  • V0.8.0-09.03.2018-compare v0.7.1…master

    • Updates for Python v3 and Django 1.11
  • V0.7.1-20.08.2015-compare v0.6.3…v0.7.1

    • Changes for django 1.5 support
    • change setup install_requires to Django v1.3.x - v1.5.x
    • Bugfix in templates: missed i18n
  • 2012年8月24日-5月6日

    • remove auto commit date from version
  • V0.6.2

    • Auto cleanup ProcessInfo table to protect against overloading.
    • Don’t insert django-processinfo “time cost” info if response.status_code is not 200
  • V0.6.1

    • Tested also with django v1.4
    • change setup install_requires to Django v1.3.x - v1.4.x
  • 0.6.0版

    • Add “Reset all data” in object tools.
    • Make “Remove dead PIDs” and “Reset all data” available on both admin pages.
  • 第5.5.2版

  • 第5.5.1版

    • Add “Remove dead PIDs” as admin view in “Process statistics” object tools (top, right, grey links)
  • 0.5.0版

    • Model changes: Please recreate tables, e.g.: ^{tt1}$
    • New: Display some static system informations (uname, domain name, ip adress, python version, sys.prefix)
    • New: current living processes (also per site)
    • display sum of user/system mode time
  • V0.4.1

  • v0.4

    • Bugfix with “Total created processes”
    • Display “Process lifetime”
  • 0.3.0版

    • Display some system information from /proc/meminfo and ‘load average’
    • Many Bugfixes
  • 0.2.0版

    • Many things changes! Recreate tables, e.g: ^{tt1}$
  • 0.1.0版

    • first Version

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动应用程序:JNLP错误   java根据用户输入在PreparedStatement中使用setTime()或setNull()   java EJB与同步   java以object为键通过hashmap进行搜索   java中的模10^9+7   针对包含其他对象的对象的java OOP最佳实践   如何将字符串作为HTML代码从Java文件读取到JSP页面?   java我的POM怎么了?“解析表达式..检测到递归表达式循环”   用于Hbase的Mapreduce的java NoSuchMethodError   JAVAlang.SecurityException:权限拒绝:启动意图{act=安卓.Intent.action.MAIN cat=[安卓.Intent.category.LAUNCHER]   数组初始化谜语Java   通过arraylist搜索时的java句柄关联