Skip to content

Commit

Permalink
chore: update dependencies (#590)
Browse files Browse the repository at this point in the history
For users who build tokio-console by installing it with `cargo`, it is
common to use the `--locked` flag to indicate that the dependency
versions from the lock file should be used. So it's worth having those
dependencies up to date.

This change checks in the result of running `cargo update` without
changing the manifest (`Cargo.toml`) files.

The patch (pre-1.0 minor) version change to `tonic-build` included a
deprecation (rename) and some clippy lint allow directives in the
generated Rust files.

The update to `tracing` in the lockfile from 0.1.37 to 0.1.40 includes
the changes from tokio-rs/tracing#2562. This change causes an
instrumented future to be entered one final time when the future is
dropped, so that any code run in the drop implementation will be in the
scope of the span. This causes the number of polls recorded for a task
to be incremented by 1 right before it is dropped.

Due to this change, some of the `console-subscriber` tests needed to be
updated. This behaviour was already present for many application using
the `console-subscriber`, but not yet in the tests because we hadn't
updated the lockfile for a while.
  • Loading branch information
hds authored Oct 22, 2024
1 parent ae17230 commit f4ee0df
Show file tree
Hide file tree
Showing 14 changed files with 653 additions and 713 deletions.
1,107 changes: 525 additions & 582 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ The Tokio console: a debugger for async Rust.
Usage: tokio-console[EXE] [OPTIONS] [TARGET_ADDR] [COMMAND]
Commands:
gen-config Generate a `console.toml` config file with the
default configuration values, overridden by any
provided command-line arguments
gen-config Generate a `console.toml` config file with the default
configuration values, overridden by any provided
command-line arguments
gen-completion Generate shell completions
help Print this message or the help of the given
subcommand(s)
subcommand(s)
Arguments:
[TARGET_ADDR]
Expand Down
3 changes: 0 additions & 3 deletions console-api/src/generated/rs.tokio.console.async_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
///
/// This includes a list of any new async ops, and updates to the associated statistics
/// for any async ops that have changed since the last update.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AsyncOpUpdate {
/// A list of new async operations that were created since the last `AsyncOpUpdate`
Expand Down Expand Up @@ -33,7 +32,6 @@ pub struct AsyncOpUpdate {
/// An async operation is an operation that is associated with a resource
/// This could, for example, be a read or write on a TCP stream, or a receive operation on
/// a channel.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AsyncOp {
/// The async op's ID.
Expand Down Expand Up @@ -68,7 +66,6 @@ pub struct AsyncOp {
pub resource_id: ::core::option::Option<super::common::Id>,
}
/// Statistics associated with a given async operation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Stats {
/// Timestamp of when the async op has been created.
Expand Down
27 changes: 7 additions & 20 deletions console-api/src/generated/rs.tokio.console.common.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// This file is @generated by prost-build.
/// Unique identifier for each task.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Id {
/// The unique identifier's concrete value.
#[prost(uint64, tag = "1")]
pub id: u64,
}
/// A Rust source code location.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Location {
/// The file path
Expand All @@ -25,23 +23,20 @@ pub struct Location {
pub column: ::core::option::Option<u32>,
}
/// Unique identifier for metadata.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MetaId {
/// The unique identifier's concrete value.
#[prost(uint64, tag = "1")]
pub id: u64,
}
/// Unique identifier for spans.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpanId {
/// The unique identifier's concrete value.
#[prost(uint64, tag = "1")]
pub id: u64,
}
/// A message representing a key-value pair of data associated with a `Span`
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Field {
/// Metadata for the task span that the field came from.
Expand All @@ -63,7 +58,6 @@ pub mod field {
///
/// This is either represented as a string, or as an index into a `Metadata`'s
/// array of field name strings.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Name {
/// The string representation of the name.
Expand All @@ -75,7 +69,6 @@ pub mod field {
NameIdx(u64),
}
/// The value of the key-value pair.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
/// A value serialized to a string using `fmt::Debug`.
Expand All @@ -98,7 +91,6 @@ pub mod field {
/// Represents a period of time in which a program was executing in a particular context.
///
/// Corresponds to `Span` in the `tracing` crate.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Span {
/// An Id that uniquely identifies it in relation to other spans.
Expand All @@ -117,7 +109,6 @@ pub struct Span {
pub at: ::core::option::Option<::prost_types::Timestamp>,
}
/// Any new metadata that was registered since the last update.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterMetadata {
/// The new metadata that was registered since the last update.
Expand All @@ -127,7 +118,6 @@ pub struct RegisterMetadata {
/// Nested message and enum types in `RegisterMetadata`.
pub mod register_metadata {
/// One metadata element registered since the last update.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NewMetadata {
/// Unique identifier for `metadata`.
Expand All @@ -139,7 +129,6 @@ pub mod register_metadata {
}
}
/// Metadata associated with a span or event.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metadata {
/// The name of the span or event.
Expand Down Expand Up @@ -194,8 +183,8 @@ pub mod metadata {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Kind::Span => "SPAN",
Kind::Event => "EVENT",
Self::Span => "SPAN",
Self::Event => "EVENT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -250,11 +239,11 @@ pub mod metadata {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Level::Error => "ERROR",
Level::Warn => "WARN",
Level::Info => "INFO",
Level::Debug => "DEBUG",
Level::Trace => "TRACE",
Self::Error => "ERROR",
Self::Warn => "WARN",
Self::Info => "INFO",
Self::Debug => "DEBUG",
Self::Trace => "TRACE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -273,7 +262,6 @@ pub mod metadata {
/// Contains stats about objects that can be polled. Currently these can be:
/// - tasks that have been spawned
/// - async operations on resources that are performed within the context of a task
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PollStats {
/// The total number of times this object has been polled.
Expand Down Expand Up @@ -322,7 +310,6 @@ pub struct PollStats {
/// indicating how many permits they are trying to acquire vs how many are acquired.
/// These values may change over time. Therefore, they live in the runtime stats rather
/// than the static data describing the entity.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attribute {
/// The key-value pair for the attribute
Expand Down
Loading

0 comments on commit f4ee0df

Please sign in to comment.