rt-history: An RT-safe history log with error checking

Related tags

Logging rt-history
Overview

rt-history: An RT-safe history log with error checking

On crates.io On docs.rs Continuous Integration Requires rustc 1.36+

This is a bounded wait-free thread synchronization primitive which allows you to record the time evolution of some data on one thread and be able to query the last N data points on other threads.

By definition of wait-free synchronization, the producer and consumer threads cannot wait for each other, so in bad conditions (too small a buffer size, too low a thread's priority, too loaded a system...), two race conditions can occur:

  • The producer can be too fast with respect to consumers, and overwrite historical data which a consumer was still in the process of reading. This buffer overrun scenario is reported, along with the degree of overrun that occurred, which can be used to guide system parameter adjustments so that the error stops occurring.
  • The producer can be too slow with respect to consumers, and fail to write a sufficient amount of new data inbetween two consumer readouts. The precise definition of this buffer underrun error is workload-dependent, so we provide the right tool to detect it in the form of a latest data point timestamp, but we do not handle it ourselves.
let (mut input, output) = RTHistory::<u8>::new(8).split();

let in_buf = [1, 2, 3];
input.write(&in_buf[..]);

let mut out_buf = [0; 3];
assert_eq!(output.read(&mut out_buf[..]), Ok(3));
assert_eq!(in_buf, out_buf);
You might also like...
🗄️ A simple (and safe!) to consume history of Client and Studio deployment versions.

🗄️ Roblox Version Archive A simple (and safe!) to consume history of Client and Studio deployment versions. About Parsing Roblox's DeployHistory form

On the fly syntax checking for GNU Emacs
On the fly syntax checking for GNU Emacs

https://www.flycheck.org Modern on-the-fly syntax checking extension for GNU Emacs. Try it! For a more gentle introduction read the Installation instr

Use explicit container types with Scrypto! Leverage the Rust compiler's type checking to increase security and productivity when developing Radix blueprints.

Scrypto Static Types Use explicit container types with Scrypto! Leverage the Rust compiler's type checking to increase security and productivity when

Automated license checking for rust. cargo lichking is a Cargo subcommand that checks licensing information for dependencies.

cargo-lichking Automated license checking for rust. cargo lichking is a Cargo subcommand that checks licensing information for dependencies. Liches ar

A cargo subcommand for checking and applying updates to installed executables

cargo-update A cargo subcommand for checking and applying updates to installed executables Documentation Manpage Installation Firstly, ensure you have

A simple code for checking crate 'prost' on WebAssembly (🦀 + 🕸️ = 💖)

rust-wasm-prost This repository is a simple code for checking crate 'prost' on WebAssembly ( 🦀 + 🕸️ = 💖 ). What is prost? prost is a Protocol Buffe

Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub.

github-scopes-rs Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub. In many

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Execute Rust code carefully, with extra checking along the way

cargo-careful cargo careful is a tool to run your Rust code extra carefully -- opting into a bunch of nightly-only extra checks that help detect Undef

`matchable` provides a convenient enum for checking if a piece of text is matching a string or a regex.

matchable matchable provides a convenient enum for checking if a piece of text is matching a string or a regex. The common usage of this crate is used

Simplistic complier~virtual-machine that transforms AST into a Rust function, with basic type checking

rast-jit-vm rast-jit-vm is a simplistic, proof-of-concept~ish compiler / virtual machine that transforms syntax tree into a Rust function, type-checki

A HTTP Filter checking for OIDC Authentication, made for Envoy Plugins, written in Rust

WASM OIDC Plugin A plugin for Envoy written in Rust. It is a HTTP Filter, that implements the OIDC Authorization Code Flow. Requests sent to the filte

CLI tool for checking ProtonDB compatibility of your Steam games.

protondb-check protondb-check is currently in active development stage, there might be bugs or other problems. Table Of Contents About Available comma

Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.
Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.

Rustato State Manager A generical thread-safe global state manager for Rust Introduction • Features • Installation • Usage • Advanced Usage • Api Refe

Small command-line JSON Log viewer
Small command-line JSON Log viewer

fblog A small tool to view json log files. Filter To filter log messages it is possible to use lua fblog -f 'level ~= "info"' # will print all message

Rust DLT (Diagnostic Log and Trace) packet parser

dlt_parse A zero allocation rust library for basic parsing & writing DLT (Diagnostic Log and Trace) packets. Currently only the parsing and writing of

High-performance log search engine.

NOTE: This project is under development, please do not depend on it yet as things may break. MinSQL MinSQL is a log search engine designed with simpli

A nginx log explorer
A nginx log explorer

Rhit reads your nginx log files in their standard location(even gzipped), does some analysis and tells you about it in pretty tables in your console,

Log structured append-only key-value store from Rust In Action with some enhancements.

riakv Log structured, append only, key value store implementation from Rust In Action with some enhancements. Features Persistent key value store with

Comments
  • Update testbench requirement from 0.8 to 0.9

    Update testbench requirement from 0.8 to 0.9

    Updates the requirements on testbench to permit the latest version.

    Release notes

    Sourced from testbench's releases.

    v0.9.0 - 2022-08-10

    Changed

    • Update to latest crossbeam, bump minimal rustc to 1.38 accordingly.
    Changelog

    Sourced from testbench's changelog.

    [0.9.0] - 2022-08-10

    Changed

    • Update to latest crossbeam, bump minimal rustc to 1.38 accordingly.

    [0.8.1] - 2022-08-10

    Fixed

    • Pin crossbeam release to keep compatibility with rustc 1.36.

    [0.8] - 2021-01-16

    Added

    • Extracted "run under contention" part of contended_benchmark

    Changed

    • Concurrent testing and benchmarking tools now used scoped threads, eliminating the need for Arc'ing shared data.
    • Since criterion has become good enough these days, this crate does not provide benchmarking tools anymore aside from the aforementioned one.
    • We now require Rust v1.36 because crossbeam does.

    [0.7.3] - 2020-03-15

    Added

    • Add a changelog to the repository.

    Fixed

    • Improve conformance to the Rust API guidelines.
    • Minor doc tweaks.

    [0.7.2] - 2020-02-07

    Changed

    • Cleanup and deduplicate GitHub Actions configuration.

    [0.7.1] - 2020-01-29

    ... (truncated)

    Commits
    • 5978847 Bump MSRV according to crossbeam update
    • 7042b16 Tag v0.8.1
    • 870f30c Pin crossbeam to keep compatibility with 1.36
    • 38358ea Switch to cache v3
    • ca0ea54 Update to new checkout action
    • 8e8436c Add MSRV metadata to Cargo.toml
    • 15e67af Check MSRV in CI
    • 4700866 Merge pull request #1 from HadrienG2/dependabot/add-v2-config-file
    • d06c3d7 Upgrade to GitHub-native Dependabot
    • See full diff in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Update criterion requirement from 0.3 to 0.4

    Update criterion requirement from 0.3 to 0.4

    Updates the requirements on criterion to permit the latest version.

    Changelog

    Sourced from criterion's changelog.

    [0.4.0] - 2022-09-10

    Removed

    • The Criterion::can_plot function has been removed.
    • The Criterion::bench_function_over_inputs function has been removed.
    • The Criterion::bench_functions function has been removed.
    • The Criterion::bench function has been removed.

    Changed

    • HTML report hidden behind non-default feature flag: 'html_reports'
    • Standalone support (ie without cargo-criterion) feature flag: 'cargo_bench_support'
    • MSRV bumped to 1.57
    • rayon and plotters are optional (and default) dependencies.
    • Status messages ('warming up', 'analyzing', etc) are printed to stderr, benchmark results are printed to stdout.
    • Accept subsecond durations for --warm-up-time, --measurement-time and --profile-time.
    • Replaced serde_cbor with ciborium because the former is no longer maintained.
    • Upgrade clap to v3 and regex to v1.5.

    Added

    • A --discard-baseline flag for discarding rather than saving benchmark results.
    • Formal support for benchmarking code compiled to web-assembly.
    • A --quiet flag for printing just a single line per benchmark.
    • A Throughput::BytesDecimal option for measuring throughput in bytes but printing them using decimal units like kilobytes instead of binary units like kibibytes.

    Fixed

    • When using bench_with_input, the input parameter will now be passed through black_box before passing it to the benchmark.

    [0.3.6] - 2022-07-06

    Changed

    • MSRV bumped to 1.49
    • Symbol for microseconds changed from ASCII 'us' to unicode 'µs'
    • Documentation fixes
    • Clippy fixes

    [0.3.5] - 2021-07-26

    Fixed

    • Corrected Criterion.toml in the book.
    • Corrected configuration typo in the book.

    Changed

    • Bump plotters dependency to always include a bug-fix.
    • MSRV bumped to 1.46.

    ... (truncated)

    Commits
    • 5e27b69 Merge branch 'version-0.4'
    • 4d6d69a Increment version numbers.
    • 935c632 Add Throughput::BytesDecimal. Fixes #581.
    • f82ce59 Remove critcmp code (it belongs in cargo-criterion) (#610)
    • a18d080 Merge branch 'master' into version-0.4
    • f9c6b8d Merge pull request #608 from Cryptex-github/patch-1
    • 8d0224e Fix html report path
    • 2934163 Add missing black_box for bench_with_input parameters. Fixes 566.
    • dfd7b65 Add duplicated benchmark ID to assertion message.
    • ce8259e Bump criterion-plot version number.
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update testbench requirement from 0.9 to 1.0

    Update testbench requirement from 0.9 to 1.0

    Updates the requirements on testbench to permit the latest version.

    Release notes

    Sourced from testbench's releases.

    v1.0.0 - 2022-08-15

    Changed

    • Switch from crossbeam scoped threads to std scoped threads. This bumps our rustc requirements all the way up to the latest release (v1.63), but has the great advantage that we are no longer bound by the ever shifting rustc requirement of crossbeam, so this requirement can stay the same indefinitely.
    Changelog

    Sourced from testbench's changelog.

    [1.0.0] - 2022-08-15

    Changed

    • Switch from crossbeam scoped threads to std scoped threads. This bumps our rustc requirements all the way up to the latest release (v1.63), but has the great advantage that we are no longer bound by the ever shifting rustc requirements of crossbeam, so this requirement can stay indefinitely.

    [0.9.0] - 2022-08-10

    Changed

    • Update to latest crossbeam, bump minimal rustc to 1.38 accordingly.

    [0.8.1] - 2022-08-10

    Fixed

    • Pin crossbeam release to keep compatibility with rustc 1.36.

    [0.8] - 2021-01-16

    Added

    • Extracted "run under contention" part of contended_benchmark

    Changed

    • Concurrent testing and benchmarking tools now used scoped threads, eliminating the need for Arc'ing shared data.
    • Since criterion has become good enough these days, this crate does not provide benchmarking tools anymore aside from the aforementioned one.
    • We now require Rust v1.36 because crossbeam does.

    [0.7.3] - 2020-03-15

    Added

    • Add a changelog to the repository.

    Fixed

    • Improve conformance to the Rust API guidelines.
    • Minor doc tweaks.

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
Owner
Hadrien G.
Performance engineering and low-level hacking for fun and profit
Hadrien G.
Compute and derive metrics by watching a log file

Export Prometheus metrics from your web server's access log Web servers only offer limited metrics. For example, nginx only offers stub_status unless

Remi Rampin 1 Nov 4, 2022
A loki logger for the log facade

Loki Logger A loki logger for the log facade. Examples extern crate log; extern crate loki_logger; use log::LevelFilter; #[tokio::main] async fn main

Thomas Nicollet 11 Dec 24, 2022
Log for concurrent workloads, with support for atomic batches and in-order recovery

sharded-log A batch-oriented multi-threaded sharded log for workloads that occasionally flush logs into some other system. All batches have a 32-bit C

Komora 16 Nov 20, 2022
A cool log library built using rust-lang

RustLog A cool log library built using rust-lang Installation: Cargo.toml rustlog = { git = "https://github.com/krishpranav/rustlog" } log = "0.4.17"

Krisna Pranav 2 Jul 21, 2022
Ergonomic and precise error handling provided by error sets. Inspired by Zig's error set type.

Error Set Error Set simplifies error management by providing a streamlined method for defining errors and easily converting between them. Resultingly,

Henry 61 Jul 24, 2024
Log agent to replay time-stamped log stream

replayman Log agent to replay time-stamped log stream. Getting started Installation cargo install replayman Prepare for your data TSV with a header li

SpringQL 3 Dec 23, 2022
miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

Kat Marchán 1.2k Jan 1, 2023
Bam Error Stats Tool (best): analysis of error types in aligned reads.

best Bam Error Stats Tool (best): analysis of error types in aligned reads. best is used to assess the quality of reads after aligning them to a refer

Google 54 Jan 3, 2023
derive(Code) simplifies error handling by providing an easy-to-use enumeration of error codes

enum-code Introduction enum-code is a derive macro for enum types. This library generates code that associates error codes with error types. It can be

Bay 5 Jun 14, 2023
This library provides a convenient derive macro for the standard library's std::error::Error trait.

derive(Error) This library provides a convenient derive macro for the standard library's std::error::Error trait. [dependencies] therror = "1.0" Compi

Sebastian Thiel 5 Oct 23, 2023