Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add format to readme #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,48 @@ dependencies all the way to the top-level application like so:
Examples / Usage
================
There are a few examples of usage in the examples folder.


Memory Layout Specification
===========================

The class preallocates memory at construction with the following layout:

+-------------------------+-------------------+-------------------------------------------+
| **Field** | **Size (bytes)** | **Description** |
+=========================+===================+===========================================+
| **Header** | 10 | Static metadata written once. |
| | | |
| - Endianness | 1 | Indicates big-endian or little-endian. |
| - Protocol version | 1 | Protocol version identifier. |
| - Total name bytes | 2 | Total bytes allocated for names. |
| - Total description | 2 | Total bytes allocated for descriptions. |
| - # of 8-byte metrics | 2 | Number of 8-byte-value metrics. |
| - # of 1-byte metrics | 2 | Number of 1-byte-value metrics. |
+-------------------------+-------------------+-------------------------------------------+
| **Name Sizes** | 2 per metric | Byte size of each metric name. |
+-------------------------+-------------------+-------------------------------------------+
| **Description Sizes** | 2 per metric | Byte size of each metric description. |
+-------------------------+-------------------+-------------------------------------------+
| **Metric Names** | Variable | Names of the metrics. |
+-------------------------+-------------------+-------------------------------------------+
| **Descriptions** | Variable | Descriptions of the metrics. |
+-------------------------+-------------------+-------------------------------------------+
| **Metric Types** | 1 per metric | Specifies the type of each metric. |
+-------------------------+-------------------+-------------------------------------------+
| **Metric Flags** | 1 per metric | Initialization and constant flags. |
+-------------------------+-------------------+-------------------------------------------+
| **Padding** | Up to 7 | Alignment padding for memory boundaries. |
+-------------------------+-------------------+-------------------------------------------+
| **8-Byte Values** | 8 per metric | Values for 8-byte metrics. |
+-------------------------+-------------------+-------------------------------------------+
| **1-Byte Values** | 1 per metric | Values for 1-byte metrics. |
+-------------------------+-------------------+-------------------------------------------+
| **Bitmap** | 1 per 8 metrics | Bitmap indicating initialized metrics. |
+-------------------------+-------------------+-------------------------------------------+

Notes
-----

- **Static Sections (1–8)**: These fields are written once during initialization.
- **Dynamic Sections (9–11)**: These fields are updated as metrics are initialized or modified.