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

Method stats

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

Source from the content-addressed store, hash-verified

967 }
968
969 fn stats(&self) -> Result<(), Error> {
970 if !self.is_avoid_stats() && !self.is_offline() {
971 let props = Props {
972 browser: self.get_browser_name().to_ascii_lowercase(),
973 browser_version: self.get_browser_version().to_ascii_lowercase(),
974 os: self.get_os().to_ascii_lowercase(),
975 arch: self
976 .get_normalized_arch()
977 .unwrap_or(ARCH_OTHER)
978 .to_ascii_lowercase(),
979 lang: self.get_language_binding().to_ascii_lowercase(),
980 selenium_version: self.get_selenium_version().to_ascii_lowercase(),
981 };
982 let http_client = self.get_http_client().to_owned();
983 let sender = self.get_sender().to_owned();
984 let cache_path = self.get_cache_path()?;
985 let mut metadata = get_metadata(self.get_logger(), &cache_path);
986 if !is_stats_in_metadata(&metadata.stats, &props) {
987 self.get_logger()
988 .debug(format!("Sending stats to Plausible: {:?}", props,));
989 let stats_ttl = self.get_ttl();
990 if stats_ttl > 0 {
991 metadata
992 .stats
993 .push(create_stats_metadata(&props, stats_ttl));
994 write_metadata(&metadata, self.get_logger(), cache_path);
995 }
996 thread::spawn(move || {
997 send_stats_to_plausible(http_client, props, sender);
998 });
999 }
1000 }
1001 Ok(())
1002 }
1003
1004 fn check_error_with_driver_in_path(
1005 &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