Configurable monitoring endpoint frequency (#3530)

## Issue Addressed

Closes #3514

## Proposed Changes

- Change default monitoring endpoint frequency to 120 seconds to fit with 30k requests/month limit.
- Allow configuration of the monitoring endpoint frequency using `--monitoring-endpoint-frequency N` where `N` is a value in seconds.
This commit is contained in:
Michael Sproul
2022-09-05 08:29:00 +00:00
parent 177aef8f1e
commit 9a7f7f1c1e
9 changed files with 105 additions and 4 deletions

View File

@@ -443,3 +443,16 @@ fn no_strict_fee_recipient_flag() {
.run()
.with_config(|config| assert!(!config.strict_fee_recipient));
}
#[test]
fn monitoring_endpoint() {
CommandLineTest::new()
.flag("monitoring-endpoint", Some("http://example:8000"))
.flag("monitoring-endpoint-period", Some("30"))
.run()
.with_config(|config| {
let api_conf = config.monitoring_api.as_ref().unwrap();
assert_eq!(api_conf.monitoring_endpoint.as_str(), "http://example:8000");
assert_eq!(api_conf.update_period_secs, Some(30));
});
}