Add new option to --disable-telemetry to disable quickinstall statistics collection (#1831)

* Add new option `--disable-quick-install-stats`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Send quickinstall stats in parallel

This commit also make sure'the stats is always sent for
each fetcher, regardless of whether it is picked or not,
to make sure that the quick-install stats collection gets
the full infomration of possible targets.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Rename option to `--disable-telemetry`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Update args.rs

Co-authored-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Update args.rs

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
This commit is contained in:
Jiahao XU 2024-07-26 16:03:38 +10:00 committed by GitHub
parent fa105bb8d7
commit 6809601273
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 3 deletions

View file

@ -9,3 +9,5 @@ pub use binstalk_fetchers as fetchers;
pub use binstalk_registry as registry;
pub use binstalk_types as manifests;
pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET};
pub use fetchers::QUICK_INSTALL_STATS_URL;

View file

@ -55,4 +55,5 @@ pub struct Options {
pub registry: Registry,
pub signature_policy: SignaturePolicy,
pub disable_telemetry: bool,
}

View file

@ -175,8 +175,13 @@ async fn resolve_inner(
);
}
if !opts.disable_telemetry {
for fetcher in &handles {
fetcher.clone().report_to_upstream();
}
}
for fetcher in handles {
fetcher.clone().report_to_upstream();
match AutoAbortJoinHandle::new(fetcher.clone().find())
.flattened_join()
.await