-
Notifications
You must be signed in to change notification settings - Fork 400
feat: Allow configuring NetReport #4020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rklaehn
wants to merge
10
commits into
main
Choose a base branch
from
configure-probes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
19d7a3b
Allow configuring NetReport
rklaehn 1c65cd4
shut up clippy!
rklaehn 32e1c26
Merge branch 'main' into configure-probes
rklaehn 35e351f
Add a built in minimal setting for NetReportConfig
rklaehn 874a9b1
Merge branch 'main' into configure-probes
rklaehn 37e3e2e
Rename config to user_config
rklaehn 2b94917
Merge branch 'main' into configure-probes
rklaehn fa53600
PR review feedback:
rklaehn 21bb422
Merge branch 'main' into configure-probes
rklaehn aa5684d
Merge branch 'main' into configure-probes
rklaehn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,34 @@ pub use self::{ | |
| }; | ||
| pub(crate) use self::{options::Options, reportgen::QuicConfig}; | ||
|
|
||
| /// Configuration for the net report service. | ||
| /// | ||
| /// Controls which probes and checks are performed when generating network reports. | ||
| /// All options default to `true`. | ||
| #[derive(Debug, Clone)] | ||
| #[non_exhaustive] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| pub struct Config { | ||
| /// Run HTTPS latency probes against relay servers. | ||
| /// | ||
| /// Disable this on constrained devices where the extra TCP connections are | ||
| /// too expensive — QAD (UDP) probes already measure relay latency. | ||
|
rklaehn marked this conversation as resolved.
Outdated
|
||
| pub https_probes: bool, | ||
| /// Check for captive portals when generating the first report. | ||
| /// | ||
| /// Disable this on embedded devices or environments where captive portal | ||
| /// detection is not meaningful. | ||
|
rklaehn marked this conversation as resolved.
Outdated
|
||
| pub captive_portal_check: bool, | ||
| } | ||
|
|
||
| impl Default for Config { | ||
| fn default() -> Self { | ||
| Self { | ||
| https_probes: true, | ||
| captive_portal_check: true, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const FULL_REPORT_INTERVAL: Duration = Duration::from_secs(5 * 60); | ||
| const ENOUGH_ENDPOINTS: usize = 3; | ||
|
|
||
|
|
@@ -100,6 +128,8 @@ pub(crate) struct Client { | |
| qad_conns: QadConns, | ||
| #[cfg(not(wasm_browser))] | ||
| tls_config: rustls::ClientConfig, | ||
| /// Whether to check for captive portals. | ||
| captive_portal_check: bool, | ||
| /// A collection of previously generated reports. | ||
| /// | ||
| /// Sometimes it is useful to look at past reports to decide what to do. | ||
|
|
@@ -239,6 +269,7 @@ impl Client { | |
| qad_conns: QadConns::default(), | ||
| #[cfg(not(wasm_browser))] | ||
| tls_config: opts.tls_config, | ||
| captive_portal_check: opts.config.captive_portal_check, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -294,6 +325,7 @@ impl Client { | |
| self.reports.last.clone(), | ||
| self.relay_map.clone(), | ||
| self.probes.clone(), | ||
| self.captive_portal_check, | ||
| if_state.clone(), | ||
| shutdown_token.child_token(), | ||
| #[cfg(not(wasm_browser))] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.