1Metrics::Any::Adapter::UFsielre(C3o)ntributed Perl DocumMeenttraitciso:n:Any::Adapter::File(3)
2
3
4
6 "Metrics::Any::Adapter::File" - write metrics to a file
7
9 use Metrics::Any::Adapter 'File', path => "metrics.log";
10
12 This Metrics::Any adapter type writes observations of metric values
13 into a file. This may be helpful while debugging or otherwise testing
14 code that reports metrics.
15
16 For example, by setting the "METRICS_ANY_ADAPTER" environment variable
17 to configure the adapter, a metric log will be written as a side-effect
18 of running a unit test:
19
20 $ METRICS_ANY_ADAPTER=File:path=metrics.log perl -Mblib t/01test.t
21
22 The generated file can then be inspected to see what metric values were
23 reported while the program was running.
24
25 In particular, specifying the file /dev/null allows the full metrics
26 generation path to be tested with the code under test seeing a "real"
27 adapter even though the output goes nowhere.
28
29 $ METRICS_ANY_ADAPTER=File:path=/dev/null ./Build test
30
31 Distribution and timing metrics are tracked with a running total and
32 count of observations.
33
35 The following additional arguments are recognised
36
37 path
38 The path to the file to write to.
39
41 Paul Evans <leonerd@leonerd.org.uk>
42
43
44
45perl v5.34.0 2021-07-25 Metrics::Any::Adapter::File(3)