Improve README.md
Some checks failed
Build Golang packages / release (push) Waiting to run
Build Docker image / build (push) Has been cancelled

This commit is contained in:
Pieter Hollander 2024-06-15 20:56:56 +02:00
parent c3af00ae7b
commit 1ca6e2085c
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -45,7 +45,7 @@ For D1-3 and R1-3, either Dx or Rx will be active. Therefore, their storage requ
| D1-3, R1-3 | 4 bytes | 10.52 | 3 | 31.56 | | D1-3, R1-3 | 4 bytes | 10.52 | 3 | 31.56 |
| **Total** | | | | **137.99** | | **Total** | | | | **137.99** |
### Theoretical storage requirements without optimisations: ### Theoretical storage requirements without optimisations
| Column | Column size (bytes) | Per month (MB) | X | Total (MB) | | Column | Column size (bytes) | Per month (MB) | X | Total (MB) |
|:--------------------|---------------------|---------------:|----|-----------:| |:--------------------|---------------------|---------------:|----|-----------:|
@ -53,9 +53,25 @@ For D1-3 and R1-3, either Dx or Rx will be active. Therefore, their storage requ
| Values | 4 bytes | 10.52 | 21 | 220.92 | | Values | 4 bytes | 10.52 | 21 | 220.92 |
| **Total** | | | | **241.96** | | **Total** | | | | **241.96** |
### Conclusion ### Real-world experiences
At the expense of having to create more complicated queries for analysis and visualisation, the optimisations save at least 103.97 MB or 1-137.99/241.96 = 43% in uncompressed storage space per month. At the expense of having to create more complicated queries for analysis and visualisation, the optimisations save at least 103.97 MB or 1-137.99/241.96 = 43% in uncompressed storage space per month. In practice, the storage requirements are lower than those mentioned in the aforementioned theoretical calculations. Over 8 months, I collected a database of 1.04GB of metrics. Using ZSTD with the default level 3, the database can be compressed to just 12.77% of this.
```sh
zstd p1_backup.sql
p1_backup.sql : 12.77% ( 1.04 GiB => 136 MiB, p1_backup.sql.zst)
```
It is therefore recommended to use filesystems supporting compression, such as BTRFS. The P1 logger operating on a btrfs filesystem with compression enabled at default levels, can store the aforementioned 1.04GB of metrics in just 136MB of physical disk space. With the highest ZSTD compression level, 19, the 1.04GB database is stored in just 8.14% of its original size.
```sh
zstd -19 p1_backup.sql
p1_backup.sql : 8.14% ( 1.04 GiB => 86.6 MiB, p1_backup.sql.zst)
```
### Storage requirements conclusion
Theoretically, but based on real-world data, a full year of P1 metrics logged by this program can be stored in in around 233MB of physical disk space.
### Columns ### Columns
@ -80,8 +96,11 @@ P1 Logger relies on a JSON input provided by a P1 reader.
The reader should send its data to an MQTT broker in the following JSON structure The reader should send its data to an MQTT broker in the following JSON structure
```json ```json
TODO
``` ```
This is currently achieved using an ESP32 with ESPhome. Configuration files will be added soon.
## References ## References
- <http://domoticx.com/p1-poort-slimme-meter-hardware/> - <http://domoticx.com/p1-poort-slimme-meter-hardware/>