https://github.com/biblical33/metrics-recorder
Header-only C++20 library for lock-free, time-stamped metric recording in multi-threaded applications.
https://github.com/biblical33/metrics-recorder
cmake cpp cpp20 header-only libcds library lock-free logging multithreading
Last synced: 11 months ago
JSON representation
Header-only C++20 library for lock-free, time-stamped metric recording in multi-threaded applications.
- Host: GitHub
- URL: https://github.com/biblical33/metrics-recorder
- Owner: BIBlical33
- Created: 2025-06-12T17:03:49.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-21T08:20:51.000Z (about 1 year ago)
- Last Synced: 2025-06-29T10:08:36.467Z (about 1 year ago)
- Topics: cmake, cpp, cpp20, header-only, libcds, library, lock-free, logging, multithreading
- Language: C++
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metrics Recorder
[](https://cmake.org)
[](https://en.cppreference.com/w/cpp/20)
## Overview
**Metrics Recorder** is a modern, header-only C++20 library for collecting and logging time-stamped metrics in a lock-free, multi-threaded environment. It is designed for scenarios where event metrics (such as CPU usage or HTTP requests per second) must be recorded with minimal performance overhead and serialized to a human-readable log file.
## Features
- Header-only C++20 library — easy to integrate
- Lock-free metric updates using [libcds](https://github.com/khizmax/libcds) skip-list
- Supports any value type (`float`, `int`, etc.)
- Clean, timestamped text log format
- Zero interference with application threads that produce events
## Get started
[Build and Usage Guide](https://github.com/BIBlical33/metrics-recorder/wiki)
## Log Format
Each log line includes:
- A timestamp with millisecond precision
- Quoted metric names
- Corresponding values
### Example
```
2025-06-01 15:00:01.653 "CPU" 0.97 "HTTP requests RPS" 42
2025-06-01 15:00:02.653 "CPU" 1.12 "HTTP requests RPS" 30
```