Skip to content

Commit

Permalink
Add some more docstrings for 'profile'
Browse files Browse the repository at this point in the history
  • Loading branch information
comnik authored and utaal committed Jul 31, 2019
1 parent 6d56ffe commit 4cd13f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
22 changes: 10 additions & 12 deletions tdiag/src/commands/profile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! "profile" subcommand
//! "profile" subcommand: reports aggregate runtime for each
//! scope/operator.
use std::sync::{Arc, Mutex};

Expand All @@ -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<Option<std::net::TcpStream>>) -> Result<(), crate::DiagError> {

Expand All @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions tdiag/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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"),
}
Expand Down

0 comments on commit 4cd13f6

Please sign in to comment.