@@ -183,6 +183,9 @@ pub struct Configuration {
183183
184184 /// Metrics HTTP Server listening port.
185185 pub metrics_server_port : u16 ,
186+
187+ /// Time interval at which usage metrics are persisted in event database (in seconds).
188+ pub persist_usage_report_interval_in_seconds : u64 ,
186189}
187190
188191/// Uploader needed to copy the snapshot once computed.
@@ -266,6 +269,7 @@ impl Configuration {
266269 enable_metrics_server : true ,
267270 metrics_server_ip : "0.0.0.0" . to_string ( ) ,
268271 metrics_server_port : 9090 ,
272+ persist_usage_report_interval_in_seconds : 10 ,
269273 }
270274 }
271275
@@ -395,6 +399,9 @@ pub struct DefaultConfiguration {
395399
396400 /// Metrics HTTP server listening port.
397401 pub metrics_server_port : u16 ,
402+
403+ /// Time interval at which metrics are persisted in event database (in seconds).
404+ pub persist_usage_report_interval_in_seconds : u64 ,
398405}
399406
400407impl Default for DefaultConfiguration {
@@ -426,6 +433,7 @@ impl Default for DefaultConfiguration {
426433 enable_metrics_server : "false" . to_string ( ) ,
427434 metrics_server_ip : "0.0.0.0" . to_string ( ) ,
428435 metrics_server_port : 9090 ,
436+ persist_usage_report_interval_in_seconds : 10 ,
429437 }
430438 }
431439}
@@ -465,7 +473,6 @@ impl Source for DefaultConfiguration {
465473 }
466474 let mut result = Map :: new ( ) ;
467475 let myself = self . clone ( ) ;
468-
469476 insert_default_configuration ! ( result, myself. environment) ;
470477 insert_default_configuration ! ( result, myself. server_ip) ;
471478 insert_default_configuration ! ( result, myself. server_port) ;
@@ -496,6 +503,7 @@ impl Source for DefaultConfiguration {
496503 insert_default_configuration ! ( result, myself. enable_metrics_server) ;
497504 insert_default_configuration ! ( result, myself. metrics_server_ip) ;
498505 insert_default_configuration ! ( result, myself. metrics_server_port) ;
506+ insert_default_configuration ! ( result, myself. persist_usage_report_interval_in_seconds) ;
499507 result. insert (
500508 "cardano_transactions_signing_config" . to_string ( ) ,
501509 into_value ( HashMap :: from ( [
@@ -513,7 +521,6 @@ impl Source for DefaultConfiguration {
513521 ) ,
514522 ] ) ) ,
515523 ) ;
516-
517524 Ok ( result)
518525 }
519526}
0 commit comments