Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    mmstats 0.7.2

    Download button

    No screenshots available
    Downloads: 153  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Schurter | More programs
    BSD License / FREE
    March 14th, 2012, 15:42 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    mmstats description

    Stat publishing and consuming tools

    mmstats is a Python module that provides a way to expose and read (slurpstats.py) diagnostic/statistical values for applications.

    You could think of mmstats as /proc for your application and slurpstats.py as one of the procps tools.

    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
    - 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


    Using

    1. python setup.py install # Or copy mmstats.py into your project
    2. import mmstats
    3. Create a subclass of mmstats.MmStats like:

    class WebStats(mmstats.MmStats):
     status2xx = mmstats.UIntField(label='status.2XX')
     status3xx = mmstats.UIntField(label='status.3XX')
     status4xx = mmstats.UIntField(label='status.4XX')
     status5xx = mmstats.UIntField(label='status.5XX')


    4. Instantiate it once per thread/process:

    webstats = WebStats(label_prefix='web.stats.')

    5. Record some data:

    if response.status_code == 200:
     webstats.status2xx += 1


    6. Run python slurpstats.py to read it
    7. Run python mmash.py to create a web interface for stats

    Testing/Development

    1. Run your favorite Python test runner (py.test or nosetests)
    2. Run slurpstats.py
    3. Clean /tmp/mmstats-* files up

    Data Structures

    There are two types of data structures so far in mmstats:

    1. buffered
    2. unbuffered

    Buffered structures use multiple buffers for handling values which cannot be written atomically.

    Unbuffered structures have ff in the write buffer field.


    Product's homepage

    Requirements:

    · Python
    · CPython 2.6 or 2.7

    What's New in This Release: [ read full changelog ]

    · cleanstats now cleans mmstats files for alive PIDs that are owned by other users.
    · Minor cleanups to tests

      


    TAGS:

    stat publishing | stat consuming | stat | publishing | consuming

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM