From e1a7434322061bd5a0ce6b8347fb884f5f2055de Mon Sep 17 00:00:00 2001 From: "Morten V. Pedersen" Date: Tue, 3 Dec 2024 22:47:59 +0100 Subject: [PATCH 1/3] add format to readme --- README.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.rst b/README.rst index d2d8ed95..a8a90497 100644 --- a/README.rst +++ b/README.rst @@ -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 | 2 | Number of 8-byte-value metrics. | +| - # of 1-byte | 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. \ No newline at end of file From a11bccccaf9563e36d737f5f13ad10c3ec12d4d5 Mon Sep 17 00:00:00 2001 From: "Morten V. Pedersen" Date: Tue, 3 Dec 2024 22:51:54 +0100 Subject: [PATCH 2/3] add format to readme --- README.rst | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/README.rst b/README.rst index a8a90497..b5f30ba3 100644 --- a/README.rst +++ b/README.rst @@ -81,38 +81,38 @@ 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 | 2 | Number of 8-byte-value metrics. | -| - # of 1-byte | 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. | -+---------------------+---------------------+-------------------------------------------+ ++-------------------------+-------------------+-------------------------------------------+ +| **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 ----- From 2c39428b46500c6d158cf3e92ff117a33d5c9589 Mon Sep 17 00:00:00 2001 From: "Morten V. Pedersen" Date: Tue, 3 Dec 2024 22:55:50 +0100 Subject: [PATCH 3/3] add format to readme --- README.rst | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.rst b/README.rst index b5f30ba3..c98db889 100644 --- a/README.rst +++ b/README.rst @@ -82,36 +82,36 @@ Memory Layout Specification The class preallocates memory at construction with the following layout: +-------------------------+-------------------+-------------------------------------------+ -| **Field** | **Size (bytes)** | **Description** | +| **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. | +| **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. | +| **Name Sizes** | 2 per metric | Byte size of each metric name. | +-------------------------+-------------------+-------------------------------------------+ -| **Description Sizes** | 2 per metric | Byte size of each metric description. | +| **Description Sizes** | 2 per metric | Byte size of each metric description. | +-------------------------+-------------------+-------------------------------------------+ -| **Metric Names** | Variable | Names of the metrics. | +| **Metric Names** | Variable | Names of the metrics. | +-------------------------+-------------------+-------------------------------------------+ -| **Descriptions** | Variable | Descriptions of the metrics. | +| **Descriptions** | Variable | Descriptions of the metrics. | +-------------------------+-------------------+-------------------------------------------+ -| **Metric Types** | 1 per metric | Specifies the type of each metric. | +| **Metric Types** | 1 per metric | Specifies the type of each metric. | +-------------------------+-------------------+-------------------------------------------+ -| **Metric Flags** | 1 per metric | Initialization and constant flags. | +| **Metric Flags** | 1 per metric | Initialization and constant flags. | +-------------------------+-------------------+-------------------------------------------+ -| **Padding** | Up to 7 | Alignment padding for memory boundaries. | +| **Padding** | Up to 7 | Alignment padding for memory boundaries. | +-------------------------+-------------------+-------------------------------------------+ -| **8-Byte Values** | 8 per metric | Values for 8-byte metrics. | +| **8-Byte Values** | 8 per metric | Values for 8-byte metrics. | +-------------------------+-------------------+-------------------------------------------+ -| **1-Byte Values** | 1 per metric | Values for 1-byte metrics. | +| **1-Byte Values** | 1 per metric | Values for 1-byte metrics. | +-------------------------+-------------------+-------------------------------------------+ -| **Bitmap** | 1 per 8 metrics | Bitmap indicating initialized metrics. | +| **Bitmap** | 1 per 8 metrics | Bitmap indicating initialized metrics. | +-------------------------+-------------------+-------------------------------------------+ Notes