Commit c887383
authored
CLI: use library collectors (#339)
* CLI: use library collectors
use metrics_utility.library.collectors, via cli_* wrappers
cli collectors get since, until, output params,
passed to library, and used to specify collector output
exposed all exisiting collectors in the cli
limit_slicer becomes until_slicer, using until over now()
full_sync removed, unused
register description removed, unused
Issue: AAP-66077
* collector output - DictOutput, DataframeOutput, CollectorOutput
library collectors now get an output= param,
defaulting to either `DataframeOutput`, where `output.sql(db, query)` returns a pandas dataframe,
or to `DictOutput`, where `output.dict({...})` returns a dict.
for the CLI calls, `CollectorOutput` gets passed instead, initialized with a temporary path for files,
and outputs a filelist from output.sql, and a dict from output.dict.
this allows preserving the csv streaming for the cli, while keeping the
collector output a dataframe for anonymized
* review fixups
* claude fix tests
* more fixups
* unify on bool_from_env; fix 0 check
* pytest approx - ensure no rel=1e-6 for timestamps (was a 28 minutes tolerance)
* simplify the vcpu not started error flow
* test fixups
* make sure until puts this into the right day, but also always within the since/until interval
* claude up test coverage
* test_gather_ranges - update for until_slicer review changes1 parent aa754e2 commit c887383
59 files changed
Lines changed: 2030 additions & 3083 deletions
File tree
- metrics_utility
- automation_controller_billing
- base
- library
- collectors
- controller
- others
- management
- test
- base
- functional
- gather
- library
- workers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 16 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
0 commit comments