MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / stats

Method stats

rust/src/lib.rs:991–1024  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

989 }
990
991 fn stats(&self) -> Result<(), Error> {
992 if !self.is_avoid_stats() && !self.is_offline() {
993 let props = Props {
994 browser: self.get_browser_name().to_ascii_lowercase(),
995 browser_version: self.get_browser_version().to_ascii_lowercase(),
996 os: self.get_os().to_ascii_lowercase(),
997 arch: self
998 .get_normalized_arch()
999 .unwrap_or(ARCH_OTHER)
1000 .to_ascii_lowercase(),
1001 lang: self.get_language_binding().to_ascii_lowercase(),
1002 selenium_version: self.get_selenium_version().to_ascii_lowercase(),
1003 };
1004 let http_client = self.get_http_client().to_owned();
1005 let sender = self.get_sender().to_owned();
1006 let cache_path = self.get_cache_path()?;
1007 let mut metadata = get_metadata(self.get_logger(), &cache_path);
1008 if !is_stats_in_metadata(&metadata.stats, &props) {
1009 self.get_logger()
1010 .debug(format!("Sending stats to Plausible: {:?}", props,));
1011 let stats_ttl = self.get_ttl();
1012 if stats_ttl > 0 {
1013 metadata
1014 .stats
1015 .push(create_stats_metadata(&props, stats_ttl));
1016 write_metadata(&metadata, self.get_logger(), cache_path);
1017 }
1018 thread::spawn(move || {
1019 send_stats_to_plausible(http_client, props, sender);
1020 });
1021 }
1022 }
1023 Ok(())
1024 }
1025
1026 fn check_error_with_driver_in_path(
1027 &mut self,

Callers 1

mainFunction · 0.80

Implementers 8

edge.rsrust/src/edge.rs
iexplorer.rsrust/src/iexplorer.rs
safaritp.rsrust/src/safaritp.rs
electron.rsrust/src/electron.rs
chrome.rsrust/src/chrome.rs
firefox.rsrust/src/firefox.rs
grid.rsrust/src/grid.rs
safari.rsrust/src/safari.rs

Calls 15

get_metadataFunction · 0.85
is_stats_in_metadataFunction · 0.85
create_stats_metadataFunction · 0.85
write_metadataFunction · 0.85
send_stats_to_plausibleFunction · 0.85
is_avoid_statsMethod · 0.80
is_offlineMethod · 0.80
get_browser_versionMethod · 0.80
get_osMethod · 0.80
get_normalized_archMethod · 0.80
get_language_bindingMethod · 0.80
get_selenium_versionMethod · 0.80

Tested by

no test coverage detected