diff --git a/tdiag/src/commands/profile.rs b/tdiag/src/commands/profile.rs index 1ad4798..abcd9d0 100644 --- a/tdiag/src/commands/profile.rs +++ b/tdiag/src/commands/profile.rs @@ -1,4 +1,5 @@ -//! "profile" subcommand +//! "profile" subcommand: reports aggregate runtime for each +//! scope/operator. use std::sync::{Arc, Mutex}; @@ -14,15 +15,15 @@ use timely::logging::TimelyEvent::{Operates, Schedule}; use tdiag_connect::receive::ReplayWithShutdown; -// static GRAPH_HTML: &str = include_str!("graph/dataflow-graph.html"); - -/// Creates TODO +/// Prints aggregate time spent in each scope/operator. /// -/// 1. Listens to incoming connection from a timely-dataflow program with -/// logging enabled; -/// 2. runs a differential-dataflow program TODO -// /// TODO This module includes `graph/dataflow-graph.html` as a static resource. -pub fn listen_and_compute( +/// 1. Listens to incoming connections from a timely-dataflow program +/// with logging enabled; +/// 2. runs a differential-dataflow program to track scheduling events +/// and derive runtime for each operator; +/// 3. prints the resulting measurements alongside operator names and +/// scope names; +pub fn listen_and_profile( timely_configuration: timely::Configuration, sockets: Vec>) -> Result<(), crate::DiagError> { @@ -31,9 +32,6 @@ pub fn listen_and_compute( let (output_send, output_recv) = ::std::sync::mpsc::channel(); let output_send = Arc::new(Mutex::new(output_send)); - // let (channels_send, channels_recv) = ::std::sync::mpsc::channel(); - // let channels_send = Arc::new(Mutex::new(channels_send)); - let is_running = Arc::new(std::sync::atomic::AtomicBool::new(true)); let is_running_w = is_running.clone(); diff --git a/tdiag/src/main.rs b/tdiag/src/main.rs index f07dd41..cc25f13 100644 --- a/tdiag/src/main.rs +++ b/tdiag/src/main.rs @@ -49,7 +49,7 @@ You can customize the interface and port for the receiver (this program) with -- .required(true)) ) .subcommand(clap::SubCommand::with_name("profile") - .about("TODO") + .about("Print total time spent running each operator") ) .get_matches(); @@ -84,7 +84,7 @@ You can customize the interface and port for the receiver (this program) with -- println!("Listening for {} connections on {}:{}", source_peers, ip_addr, port); let sockets = tdiag_connect::receive::open_sockets(ip_addr, port, source_peers)?; println!("Trace sources connected"); - crate::commands::profile::listen_and_compute(timely_configuration, sockets) + crate::commands::profile::listen_and_profile(timely_configuration, sockets) }, _ => panic!("Invalid subcommand"), }