@@ -44,12 +44,24 @@ pub static STORAGE_FILES_SCANNED: Lazy<CounterVec> = Lazy::new(|| {
4444    . expect ( "metric can be created" ) 
4545} ) ; 
4646
47+ pub  static  STORAGE_FILES_SCANNED_DATE :  Lazy < CounterVec >  = Lazy :: new ( || { 
48+     CounterVec :: new ( 
49+         Opts :: new ( 
50+             "storage_files_scanned_date_total" , 
51+             "Total number of files scanned in storage operations by date" , 
52+         ) 
53+         . namespace ( METRICS_NAMESPACE ) , 
54+         & [ "provider" ,  "operation" ,  "date" ] , 
55+     ) 
56+     . expect ( "metric can be created" ) 
57+ } ) ; 
58+ 
4759pub  trait  StorageMetrics  { 
4860    fn  register_metrics ( & self ,  handler :  & PrometheusMetrics ) ; 
4961} 
5062
5163pub  mod  localfs { 
52-     use  crate :: storage:: FSConfig ; 
64+     use  crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE ,  storage :: FSConfig } ; 
5365
5466    use  super :: { STORAGE_FILES_SCANNED ,  STORAGE_REQUEST_RESPONSE_TIME ,  StorageMetrics } ; 
5567
@@ -63,12 +75,16 @@ pub mod localfs {
6375                . registry 
6476                . register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) ) 
6577                . expect ( "metric can be registered" ) ; 
78+             handler
79+                 . registry 
80+                 . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) ) 
81+                 . expect ( "metric can be registered" ) ; 
6682        } 
6783    } 
6884} 
6985
7086pub  mod  s3 { 
71-     use  crate :: storage:: S3Config ; 
87+     use  crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE ,  storage :: S3Config } ; 
7288
7389    use  super :: { STORAGE_FILES_SCANNED ,  STORAGE_REQUEST_RESPONSE_TIME ,  StorageMetrics } ; 
7490
@@ -82,12 +98,16 @@ pub mod s3 {
8298                . registry 
8399                . register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) ) 
84100                . expect ( "metric can be registered" ) ; 
101+             handler
102+                 . registry 
103+                 . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) ) 
104+                 . expect ( "metric can be registered" ) ; 
85105        } 
86106    } 
87107} 
88108
89109pub  mod  azureblob { 
90-     use  crate :: storage:: AzureBlobConfig ; 
110+     use  crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE ,  storage :: AzureBlobConfig } ; 
91111
92112    use  super :: { STORAGE_FILES_SCANNED ,  STORAGE_REQUEST_RESPONSE_TIME ,  StorageMetrics } ; 
93113
@@ -101,12 +121,16 @@ pub mod azureblob {
101121                . registry 
102122                . register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) ) 
103123                . expect ( "metric can be registered" ) ; 
124+             handler
125+                 . registry 
126+                 . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) ) 
127+                 . expect ( "metric can be registered" ) ; 
104128        } 
105129    } 
106130} 
107131
108132pub  mod  gcs { 
109-     use  crate :: storage:: GcsConfig ; 
133+     use  crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE ,  storage :: GcsConfig } ; 
110134
111135    use  super :: { STORAGE_FILES_SCANNED ,  STORAGE_REQUEST_RESPONSE_TIME ,  StorageMetrics } ; 
112136
@@ -120,6 +144,10 @@ pub mod gcs {
120144                . registry 
121145                . register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) ) 
122146                . expect ( "metric can be registered" ) ; 
147+             handler
148+                 . registry 
149+                 . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) ) 
150+                 . expect ( "metric can be registered" ) ; 
123151        } 
124152    } 
125153} 
0 commit comments