31 Jan 2022 21:31:57 UTC
- Distribution: Prometheus-Tiny-Shared
- Module version: 0.026
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (234 / 0 / 0)
- KwaliteeBus factor: 1
- 95.03% Coverage
- License: perl_5
- Activity24 month
- Download (17.34KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
Prometheus::Tiny::Shared - A tiny Prometheus client with a shared database behind it
use Prometheus::Tiny::Shared; my $prom = Prometheus::Tiny::Shared->new;
Prometheus::Tiny::Sharedis a wrapper around Prometheus::Tiny that instead of storing metrics data in a hashtable, stores them in a shared datastore (provided by Hash::SharedMem, though this may change in the future). This lets you keep a single set of metrics in a multithreaded app.
Prometheus::Tiny::Sharedshould be a drop-in replacement for
Prometheus::Tiny. Any differences in behaviour is a bug, and should be reported.
my $prom = Prometheus::Tiny::Shared->new(filename => ...);
filename, if provided, will name an on-disk location to store the backing store. If not supplied, a temporary location will be created and destroyed when your program ends, so suitable for testing purposes. For best performance, this should be stored on some kind of memory-backed filesystem (eg Linux
tmpfs). The store is not intended to be a persistant, durable store (Prometheus will handle metrics resetting to zero correctly), so you don't need to worry about backing it up or any other maintenance.
init_file, if set to true, will overwrite any existing data file with the given name. If you do this while you already have existing
Prometheus::Tiny::Sharedobjects using the old file, strange things will probably happen. Don't do that.
cache_argsargument will cause the constructor to croak. Code using this arg in previous versions of Prometheus::Tiny::Shared no longer work, and needs to be updated to use the
Please report any bugs or feature requests through the issue tracker at https://github.com/robn/Prometheus-Tiny-Shared/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
git clone https://github.com/robn/Prometheus-Tiny-Shared.git
Rob N ★ <email@example.com>
This software is copyright (c) 2017 by Rob N ★
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Prometheus::Tiny::Shared, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Prometheus::Tiny::Shared
For more information on module installation, please visit the detailed CPAN module installation guide.