百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mmstats

> 编程语言
开源

内存映射统计信息工具

100 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

内存映射统计信息工具

Documentation _ | Package _ | Code _

.. image:: https://secure.travis-ci.org/schmichael/mmstats.png?branch=master :target: http://travis-ci.org/schmichael/mmstats/

Not under active development

About

Mmstats is a way to expose and read diagnostic values and metrics for applications.

Think of mmstats as /proc for your application and the readers as procps utilities.

This project is a Python implementation, but compatible implementations can be made in any language (see Goals).

Discuss at https://groups.google.com/group/python-introspection

Goals

  • Separate publishing/writing from consuming/reading tools

  • Platform/language independent (a Java writer can be read by a Python tool)

  • Predictable performance impact for writers via:

    • No locks (1 writer per thread)
    • No syscalls (after instantiation)
    • All in userspace
    • Reading has no impact on writers
  • Optional persistent (writer can sync anytime)

  • 1-way (Publish/consume only; mmstats are not management extensions)

Usage

Requirements

CPython 2.6 or 2.7 (Windows is untested)

PyPy (only tested in 1.7, should be faster in 1.8)

Using

  1. easy_install mmstats or pip install mmstats or if you've downloaded the source: python setup.py install
  2. Then in your Python project create a sublcass of mmstats.MmStats like

.. code-block:: python

import mmstats

class WebStats(mmstats.MmStats):
    status2xx = mmstats.CounterField(label='status.2XX')
    status3xx = mmstats.CounterField(label='status.3XX')
    status4xx = mmstats.CounterField(label='status.4XX')
    status5xx = mmstats.CounterField(label='status.5XX')
    last_hit = mmstats.DoubleField(label='timers.last_hit')
  1. Instantiate it once per process: (instances are automatically thread local)

.. code-block:: python

webstats = WebStats(label_prefix='web.stats.')
  1. Record some data:

.. code-block:: python

if response.status_code == 200:
    webstats.status2xx.inc()

webstats.last_hit = time.time()
  1. Run slurpstats to read it
  2. Run mmash to create a web interface for stats
  3. Run pollstats -p web.stats.status 2XX,3XX,4XX,5XX /tmp/mmstats-* for a vmstat/dstat like view.
  4. Did a process die unexpectedly and leave around a stale mmstat file? cleanstats /path/to/mmstat/files will check to see which files are stale and remove them.

.. include:: CHANGES.rst :end-before: 0.5.0

Issues· 13 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言