Skip to content

Commit

Permalink
Begin documenting data structures
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Aug 19, 2011
1 parent 2a3f186 commit a6dfa3e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.rst
Expand Up @@ -36,3 +36,44 @@ Testing/Development
#. Run slurpstats.py
#. Clean /tmp/mmstats-* files up

===============
Data Structures
===============

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

#. buffered
#. unbuffered

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

Unbuffered structures have ff in the write buffer field.

--------
Buffered
--------

+============+==================+======+==============+=========+
| label size | label | type | write buffer | buffers |
+============+==================+======+==============+=========+
| ushort | label size bytes | char | byte | varies |
+------------+------------------+------+--------------+---------+

The buffers field length = sizeof(type) * buffers.

The current write buffer is referenced by: write_buffer * sizeof(type)

TODO: field for total number of buffers?

----------
Unbuffered
----------

+============+==================+======+==============+=========+
| label size | label | type | write buffer | value |
+============+==================+======+==============+=========+
| ushort | label size bytes | char | ff | varies |
+------------+------------------+------+--------------+---------+

The value field length = sizeof(type).

0 comments on commit a6dfa3e

Please sign in to comment.