提供页面加载时间的细分

django-speedbar的Python项目详细描述


https://codeship.com/projects/72818310-a428-0133-4c94-120ced3a4ed3/status?branch=masterhttps://github.com/theospears/django-speedbar/raw/master/docs/images/chrome-speedtracer.png

Django SpeedBar检测页面加载过程中的关键事件(数据库 查询、模板呈现、url解析等)并提供摘要 每个页面加载的信息,以及与google chrome的集成 SpeedTracer显示页面加载中发生的事件树。

它被设计为在实时站点上运行,对性能的影响最小。 虽然所有请求都被监视,但结果只对用户可见 带着国旗。

安装

若要安装Django SpeedBar,请将其添加到已安装的应用程序、URL中,并添加 SpeedBar中间件。

# settings.pyINSTALLED_APPS=[# ...'speedbar',# ...]# For best results put speedbar as near to the top of your middleware# list as possible. django-speedbar listens to the django request_finished# signal so actions performed by middleware higher up the stack will still# be recorded, but will not be included in summary data.MIDDLEWARE_CLASSES=['speedbar.middleware.SpeedbarMiddleware',# ...]
# urls.pyurlpatterns=patterns('',# ...(r'^speedbar/',include('speedbar.urls')),# ...)

要在SpeedTracer中查看结果,还需要安装 SpeedTracer plugin

要在页面中包含摘要信息,可以使用metric模板 标签

{% load speedbar %}
<divclass="speedbar"><span>Overall: {% metric "overall" "time" %} ms</span><span>SQL: {% metric "sql" "count" %} ({% metric "sql" "time" %} ms)</span><!-- ... --></div>

配置

Django SpeedBar有许多配置设置。

# Enable instrumentation of page load processSPEEDBAR_ENABLE=True# Enable the summary data template tagsSPEEDBAR_PANEL=True# Include headers needed to show page generation profile tree in the# Google Chrome SpeedTracer plugin.SPEEDBAR_TRACE=True# Include response headers with summary data for each request. These are# intended for logging and are included in all requests, not just staff# requests. If you turn this on we recommend configuring your load# balancer to strip them before sending the response to the client.SPEEDBAR_RESPONSE_HEADERS=False# Configure which instrumentation modules to load. This should not# normally be necessary for built in modules as they will only load# if the relevant clients are installed, but is useful for adding# additional custom modules.SPEEDBAR_MODULES=['speedbar.modules.stacktracer',# Most other modules depend on this one'speedbar.modules.pagetimer','speedbar.modules.sql','myproject.modules.sprockets',# ...]

状态

我们的生产系统安装了Django Speedbar。但是,api 不稳定,可能会改变。它还没有任何违约 模板,以便更容易地使用页面上的功能。

类似项目

有许多类似的项目你可能也要考虑 或者代替Django Speedbar。

django调试工具栏

网址:https://github.com/django-debug-toolbar/django-debug-toolbar

德詹戈佩奇的瑞士军刀检查。成熟,广泛使用,和 有很多可用的插件。它更注重调试和 信息,较少关注绩效衡量。我们也找到了 在我们的生产现场运行缓慢。

新遗迹

网站:http://newrelic.com/

一个深入的应用监控平台。对观察非常有用 应用程序性能和页面加载时间的趋势。对 深入单个页面加载,并支持较小的 一套外部服务。商业产品。

django live profiler

网址:http://invitebox.github.io/django-live-profiler/

用于django应用程序的站点范围探查器。我没用过这个,所以 无法对此发表评论。

学分

Django Speedbar主要是由西奥·斯皮尔斯在Mixcloud工作时写的。

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

推荐PyPI第三方库


热门话题
java访问私有字段而不使用getter方法?   使用PowerMockito在JavaEWSAPI中模拟测试拉订阅   启动活动时未保存java首选项并清除变量   java如何在servlet中检索子域?斯普林有帮手吗   java使用Docker从命令行构建Android项目   java Android,ActionBar后退按钮(setDisplayHomeAsUpEnabled(true))重新创建父活动   java在重用FileOutputStream时应该关闭流吗?   java使用RESTAPI将文件上载到s3 bucket   Java SOAP Web服务应用程序中的mysql用户登录方法不工作   java使用多个数字计算百分比并转换为长   java Android SQLiteDatabase查询忽略空格   java如何在Javafx中比较两个字段文本   java错误:未设置java_HOME,在Eclipse安装后找不到   java在安卓中保存对象   java如何使用jaxws从返回List<Object>的服务中检索值   java Google OAuth2 JWT令牌验证异常   SpringMVC中的JavaUTF8编码问题,当从JSP表单发送POST请求中的越南语信件时   java从webview重定向到安卓应用程序   JUnit 5中多个扩展的java顺序