diff options
-rw-r--r-- | Cargo.lock | 16 | ||||
-rw-r--r-- | components/config/opts.rs | 10 | ||||
-rw-r--r-- | components/profile/Cargo.toml | 1 | ||||
-rw-r--r-- | components/profile/time.rs | 49 |
4 files changed, 2 insertions, 74 deletions
diff --git a/Cargo.lock b/Cargo.lock index c08b24c36bb..7a13dc062dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2686,21 +2686,6 @@ dependencies = [ ] [[package]] -name = "influent" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fdeaaa9b5aacb83901de1bb66b32ec574a327758657404c1edf06f5a6ac0f0" -dependencies = [ - "base64 0.10.1", - "futures", - "http", - "hyper", - "tokio", - "tokio-executor", - "url", -] - -[[package]] name = "io-surface" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4270,7 +4255,6 @@ name = "profile" version = "0.0.1" dependencies = [ "heartbeats-simple", - "influent", "ipc-channel", "libc", "log", diff --git a/components/config/opts.rs b/components/config/opts.rs index c1b05a83971..66a626d390f 100644 --- a/components/config/opts.rs +++ b/components/config/opts.rs @@ -37,8 +37,6 @@ pub struct Opts { /// (`i.e. -p 5`). /// - a file path to write profiling info to a TSV file upon Servo's termination. /// (`i.e. -p out.tsv`). - /// - an InfluxDB hostname to store profiling info upon Servo's termination. - /// (`i.e. -p http://localhost:8086`) pub time_profiling: Option<OutputOptions>, /// When the profiler is enabled, this is an optional path to dump a self-contained HTML file @@ -452,7 +450,6 @@ fn print_debug_usage(app: &str) -> ! { #[derive(Clone, Debug, Deserialize, Serialize)] pub enum OutputOptions { /// Database connection config (hostname, name, user, pass) - DB(ServoUrl, Option<String>, Option<String>, Option<String>), FileName(String), Stdout(f64), } @@ -743,12 +740,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR Some(argument) => match argument.parse::<f64>() { Ok(interval) => Some(OutputOptions::Stdout(interval)), Err(_) => match ServoUrl::parse(&argument) { - Ok(url) => Some(OutputOptions::DB( - url, - opt_match.opt_str("profiler-db-name"), - opt_match.opt_str("profiler-db-user"), - opt_match.opt_str("profiler-db-pass"), - )), + Ok(_) => panic!("influxDB isn't supported anymore"), Err(_) => Some(OutputOptions::FileName(argument)), }, }, diff --git a/components/profile/Cargo.toml b/components/profile/Cargo.toml index 1a5bab4dd2d..28b90665712 100644 --- a/components/profile/Cargo.toml +++ b/components/profile/Cargo.toml @@ -12,7 +12,6 @@ path = "lib.rs" [dependencies] profile_traits = {path = "../profile_traits"} -influent = "0.5" ipc-channel = "0.14" heartbeats-simple = "0.4" log = "0.4" diff --git a/components/profile/time.rs b/components/profile/time.rs index f5fbd456b67..59cc376acab 100644 --- a/components/profile/time.rs +++ b/components/profile/time.rs @@ -6,9 +6,6 @@ use crate::heartbeats; use crate::trace_dump::TraceDump; -use influent::client::{Client, Credentials}; -use influent::create_client; -use influent::measurement::{Measurement, Value}; use ipc_channel::ipc::{self, IpcReceiver}; use profile_traits::energy::{energy_interval_ms, read_energy_uj}; use profile_traits::time::{ @@ -25,7 +22,6 @@ use std::path::Path; use std::time::Duration; use std::{f64, thread, u32, u64}; use time_crate::precise_time_ns; -use tokio::prelude::Future; pub trait Formattable { fn format(&self, output: &Option<OutputOptions>) -> String; @@ -198,9 +194,7 @@ impl Profiler { .expect("Thread spawning failed"); // decide if we need to spawn the timer thread match option { - &OutputOptions::FileName(_) | &OutputOptions::DB(_, _, _, _) => { - /* no timer thread needed */ - }, + &OutputOptions::FileName(_) => { /* no timer thread needed */ }, &OutputOptions::Stdout(period) => { // Spawn a timer thread let chan = chan.clone(); @@ -476,47 +470,6 @@ impl Profiler { } writeln!(&mut lock, "").unwrap(); }, - Some(OutputOptions::DB(ref hostname, ref dbname, ref user, ref password)) => { - // Unfortunately, influent does not like hostnames ending with "/" - let mut hostname = hostname.to_string(); - if hostname.ends_with("/") { - hostname.pop(); - } - - let empty = String::from(""); - let username = user.as_ref().unwrap_or(&empty); - let password = password.as_ref().unwrap_or(&empty); - let database = dbname.as_ref().unwrap_or(&empty); - let credentials = Credentials { - username: username, - password: password, - database: database, - }; - - let hosts = vec![hostname.as_str()]; - let client = create_client(credentials, hosts); - - for (&(ref category, ref meta), ref mut data) in &mut self.buckets { - data.sort_by(|a, b| a.partial_cmp(b).expect("No NaN values in profiles")); - let data_len = data.len(); - if data_len > 0 { - let (mean, median, min, max) = Self::get_statistics(data); - let category = category.format(&self.output); - let mut measurement = Measurement::new(&category); - measurement.add_field("mean", Value::Float(mean)); - measurement.add_field("median", Value::Float(median)); - measurement.add_field("min", Value::Float(min)); - measurement.add_field("max", Value::Float(max)); - if let Some(ref meta) = *meta { - measurement.add_tag("host", meta.url.as_str()); - }; - - tokio::run(client.write_one(measurement, None).map_err(|e| { - warn!("Could not write measurement to profiler db: {:?}", e) - })); - } - } - }, None => { /* Do nothing if no output option has been set */ }, }; } |