tracing more data

This commit is contained in:
Nadja Reitzenstein
2022-06-22 14:43:09 +02:00
parent aef36fa3d4
commit 2d8d6f9938
12 changed files with 98 additions and 20 deletions

View File

@ -252,11 +252,11 @@ where
{
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest {
let dropped = match (metadata.name(), metadata.target()) {
(_, "executor::task") | ("runtime.spawn", _) => {
(_, TaskVisitor::SPAWN_TARGET) | (TaskVisitor::SPAWN_NAME, _) => {
self.spawn_callsites.insert(metadata);
&self.shared.dropped_tasks
}
(_, "executor::waker") => {
(WakerVisitor::WAKE_TARGET, _) => {
self.waker_callsites.insert(metadata);
&self.shared.dropped_tasks
}
@ -268,7 +268,7 @@ where
self.async_op_callsites.insert(metadata);
&self.shared.dropped_async_ops
}
("runtime.resource.async_op.poll", _) => {
(AsyncOpVisitor::ASYNC_OP_POLL_NAME, _) => {
self.async_op_poll_callsites.insert(metadata);
&self.shared.dropped_async_ops
}

View File

@ -97,9 +97,6 @@ impl Server {
pub async fn serve(
mut self, /*, incoming: I */
) -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
// TODO: Spawn two tasks; the aggregator that's collecting stats, aggregating and
// collating them and the server task doing the tonic gRPC stuff
let svc = InstrumentServer::new(self);
tonic::transport::Server::builder()

View File

@ -240,6 +240,9 @@ impl FieldVisitor {
}
impl TaskVisitor {
pub(crate) const SPAWN_TARGET: &'static str = "executor::task";
pub(crate) const SPAWN_NAME: &'static str = "runtime.spawn";
pub(crate) fn new(meta_id: console_api::MetaId) -> Self {
TaskVisitor {
field_visitor: FieldVisitor::new(meta_id),
@ -340,6 +343,7 @@ impl Visit for FieldVisitor {
impl AsyncOpVisitor {
pub(crate) const ASYNC_OP_SPAN_NAME: &'static str = "runtime.resource.async_op";
pub(crate) const ASYNC_OP_POLL_NAME: &'static str = "runtime.resource.async_op.poll";
const ASYNC_OP_SRC_FIELD_NAME: &'static str = "source";
pub(crate) fn result(self) -> Option<(String, bool)> {
@ -365,6 +369,8 @@ impl Visit for AsyncOpVisitor {
}
impl WakerVisitor {
pub(crate) const WAKE_TARGET: &'static str = "executor::waker";
const WAKE: &'static str = "waker.wake";
const WAKE_BY_REF: &'static str = "waker.wake_by_ref";
const CLONE: &'static str = "waker.clone";