diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-18 18:21:21 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-18 18:21:21 +0200 |
| commit | e73a37b06e7282ef3212ac8e33e81d14f932fcd2 (patch) | |
| tree | 6c6eee1ab44f757f8ce611aeb0d80a4f5003402e | |
| parent | 5900a90a66137917a90a2b6b2d80a144ea406285 (diff) | |
refactor
| -rw-r--r-- | guprecords.raku | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/guprecords.raku b/guprecords.raku index b74fa03..50b99e1 100644 --- a/guprecords.raku +++ b/guprecords.raku @@ -92,7 +92,7 @@ class Aggregator { } class Reporter { - has Category $.cat is required; + has Category $.cat = 'host'; has Metric $.metric is required; has Natural $.limit is required; has Hash %.aggregates; @@ -168,18 +168,18 @@ sub do-it(Str:D \stats-dir, Reporter:D \reporter) { } multi MAIN( - Str :$stats-dir is required, - HostMetric :$metric = 'uptime', - Natural :$limit = 20, -) { - do-it($stats-dir, HostReporter.new(cat => 'host', :$metric, :$limit)); -} - -multi MAIN( Str :$stats-dir is required, #= The uptimed raw record input dir. Category :$cat is required where * ne 'host', #= The category, one of host, os, os-major, uname [default: 'host'] Metric :$metric = 'uptime', #= The metric, one of boots, uptime, meta-score, downtime, lifespan Natural :$limit = 20, #= Limit output to num of entries. ) { - do-it($stats-dir, HostReporter.new(:$cat, :$metric, :$limit)); + do-it($stats-dir, Reporter.new(:$cat, :$metric, :$limit)); +} + +multi MAIN( + Str :$stats-dir is required, + HostMetric :$metric = 'uptime', + Natural :$limit = 20, +) { + do-it($stats-dir, HostReporter.new(:$metric, :$limit)); } |
