安装“活动监视器”的简单方法对于扭曲插座工厂

发布于 2024-10-02 06:02:17 字数 318 浏览 0 评论 0原文

我希望为我的 Twisted 应用程序提供一个实时“系统状态”/“活动监视器”控制台。

该应用程序基本上是一个协议。ServerFactory 接受连接执行不同的工作。

有点像twisted.manhole,我正在寻找创建管理应用程序的最简单方法,我可以在其中检查应用程序的当前统计信息。

管理可以是一个简单的基于 ascii 的 shell 或 html/json 设置。

我知道我可以用一堆计数器来构建它,一个用于验证和监控这些计数器的单独协议,但我认为 Twisted 可能已经有了这样的东西,因为它至少知道连接数、协议类型等。

尖端?

I'd like to have a real-time 'system status'/'activity monitor' console for my Twisted application.

The app is basically a protocol.ServerFactory which accepts connections performs different jobs.

Kind of like the twisted.manhole, I'm looking for the simplest way to create a admin application where I can check the current stats of my app.

The admin can be a simple ascii-based shell or html/json setup.

I'm aware that I could build this with a bunch of counters, a separate protocol for authenticating and monitoring these, but I'm thinking Twisted might already have such thing since it at least knows the number of connections, protocol types, etc etc.

Tips?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万劫不复 2024-10-09 06:02:17

这里有一个无人维护、正在慢慢腐烂的 twisted.internet.gladereactor。如果你使用的是twistd,那么你可以简单地使用这个:

twistd --reactor debug-gui ...

如果你自己直接运行反应器,那么它只是稍微多一点努力:

from twisted.manhole import gladereactor
gladereactor.install()
from twisted.internet import reactor
...

检查功能似乎已经被破坏了一段时间,但它仍然会向您显示已建立的连接的列表以及它们所处的状态,并且它还会为您提供每个连接的流量日志。如果您正在寻找一个小项目,修复检查也可能是一项相当简单的工作。 :)

There's the unmaintained, slowly rotting twisted.internet.gladereactor. If you're using twistd, then you can use this trivally:

twistd --reactor debug-gui ...

If you're running the reactor directly yourself, then it's only slightly more effort:

from twisted.manhole import gladereactor
gladereactor.install()
from twisted.internet import reactor
...

The Inspect feature appears to have been broken for some time, but it will still show you a list of established connections and what state they are in, and it will also apparently give you a traffic log for each connection. Fixing Inspect may also be a fairly straightforward effort, in case you're looking for a little project. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文