@@ -5,28 +5,31 @@ pub mod output;
55pub mod tui;
66
77use crate :: core:: MetricCollector ;
8+ use crate :: modules:: disk:: DiskCollector ;
89use crate :: modules:: { cpu:: CpuCollector , memory:: MemoryCollector } ;
910use crate :: output:: { OutputFormat , format_output} ;
1011
1112pub fn run ( ) {
1213 let args = cli:: parse_args ( ) ;
1314
1415 // get list of collectors based on args
15- let collectors: Vec < Box < dyn MetricCollector > > = match args. module . as_deref ( ) {
16- Some ( "cpu" ) => vec ! [ Box :: new( CpuCollector :: new( ) ) ] ,
17- Some ( "memory" ) => vec ! [ Box :: new( MemoryCollector :: new( ) ) ] ,
18- Some ( _) => {
19- eprintln ! ( "Unknown module: {}" , args. module. unwrap( ) ) ;
20- std:: process:: exit ( 1 ) ;
21- }
22- None => {
23- // default to all collectors
24- vec ! [
25- Box :: new( CpuCollector :: new( ) ) ,
26- Box :: new( MemoryCollector :: new( ) ) ,
27- ]
28- }
29- } ;
16+ let collectors: Vec < Box < dyn MetricCollector > > = match args. module . as_deref ( ) {
17+ Some ( "cpu" ) => vec ! [ Box :: new( CpuCollector :: new( ) ) ] ,
18+ Some ( "memory" ) => vec ! [ Box :: new( MemoryCollector :: new( ) ) ] ,
19+ Some ( "disk" ) => vec ! [ Box :: new( DiskCollector :: new( ) ) ] ,
20+ Some ( _) => {
21+ eprintln ! ( "Unknown module: {}" , args. module. unwrap( ) ) ;
22+ std:: process:: exit ( 1 ) ;
23+ }
24+ None => {
25+ vec ! [
26+ Box :: new( CpuCollector :: new( ) ) ,
27+ Box :: new( MemoryCollector :: new( ) ) ,
28+ Box :: new( DiskCollector :: new( ) ) , // default me disk bhi add
29+ ]
30+ }
31+ } ;
32+
3033
3134 // determine output format
3235 let format = match args. output . as_deref ( ) {
0 commit comments