-
Notifications
You must be signed in to change notification settings - Fork 292
add tracing feature #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add tracing feature #452
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,13 +161,35 @@ impl<G: Scope> OperatorBuilder<G> { | |
| let inputs = self.shape.inputs; | ||
| let outputs = self.shape.outputs; | ||
|
|
||
| // Generate a tracing span for the function. | ||
| #[cfg(feature = "tracing")] | ||
| let span = { | ||
| let location = std::panic::Location::caller(); | ||
| // timely.console.span is a marker target allowing us to | ||
| // turn these spans on and off specifically | ||
| // TODO(guswynn): check with tracing folks if there is a better | ||
| // way to do this | ||
| tracing::trace_span!( | ||
| target: "timely.console.span", | ||
| "runtime.spawn", | ||
| kind = %"timely-operator", | ||
| "fn" = %std::any::type_name::<L>(), | ||
| task.name = self.shape.name.as_str(), | ||
|
Comment on lines
+175
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't know anything about timely dataflow, so...is if
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it is something that people set if using the raw builder api, or wrappers around it like For other combinators, like things like would end up with (and possible named version of the same functions in the future I need to go through and add |
||
| loc.file = location.file(), | ||
| loc.line = location.line(), | ||
| loc.col = location.column(), | ||
| ) | ||
| }; | ||
|
|
||
| let operator = OperatorCore { | ||
| shape: self.shape, | ||
| address: self.address, | ||
| activations: self.scope.activations(), | ||
| logic, | ||
| shared_progress: Rc::new(RefCell::new(SharedProgress::new(inputs, outputs))), | ||
| summary: self.summary, | ||
| #[cfg(feature = "tracing")] | ||
| span, | ||
| }; | ||
|
|
||
| self.scope.add_operator_with_indices(Box::new(operator), self.index, self.global); | ||
|
|
@@ -190,6 +212,8 @@ where | |
| shared_progress: Rc<RefCell<SharedProgress<T>>>, | ||
| activations: Rc<RefCell<Activations>>, | ||
| summary: Vec<Vec<Antichain<T::Summary>>>, | ||
| #[cfg(feature = "tracing")] | ||
| span: tracing::Span, | ||
| } | ||
|
|
||
| impl<T, L> Schedule for OperatorCore<T, L> | ||
|
|
@@ -201,6 +225,8 @@ where | |
| fn path(&self) -> &[usize] { &self.address[..] } | ||
| fn schedule(&mut self) -> bool { | ||
| let shared_progress = &mut *self.shared_progress.borrow_mut(); | ||
| #[cfg(feature = "tracing")] | ||
| let _s = self.span.enter(); | ||
| (self.logic)(shared_progress) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general,
tracingtargets are Rust module paths when they're not explicitly overrididen; so::is typically used as a separator rather than.--- the use of.is not forbidden bytracing, but it's not the general convention.i don't really understand the role of the
timely::console::spantarget --- i would probably just make thisor something if you don't want to use the full module path (the user probably doesn't care about
::generic::builder_rawhere?). you'll still be able to filter that target out without having a weird target for it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to have a set target so that if this code ever moves, set filters in our downstream binary don't break, but good point,
timely::dataflow::operatoris probably better!