Skip to content

Commit

Permalink
feat(console-api): update tonic to v0.9 (#420)
Browse files Browse the repository at this point in the history
This commit updates the Tonic dependency for `console-api` from v0.8 to
v0.9.

BREAKING CHANGE:

This is a breaking change for users of `console-api`, as it changes the
public `tonic` dependency to a semver-incompatible version. This breaks
compatibility with `tonic` 0.8.
  • Loading branch information
hawkw committed May 9, 2023
1 parent 1a94c4b commit b70c1d8
Show file tree
Hide file tree
Showing 9 changed files with 565 additions and 274 deletions.
230 changes: 133 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions console-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ keywords = [

[features]
# Generate code that is compatible with Tonic's `transport` module.
transport = ["tonic-build/transport", "tonic/transport"]
transport = ["tonic/transport"]

[dependencies]
tonic = { version = "0.8", default-features = false, features = [
tonic = { version = "0.9", default-features = false, features = [
"prost",
"codegen",
"transport",
Expand All @@ -39,7 +39,7 @@ prost-types = "0.11"
tracing-core = "0.1.17"

[dev-dependencies]
tonic-build = { version = "0.8", default-features = false, features = [
tonic-build = { version = "0.9", default-features = false, features = [
"prost", "transport"
] }
# explicit dep so we can get the version with fixed whitespace.
Expand Down
29 changes: 16 additions & 13 deletions console-api/src/generated/rs.tokio.console.async_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
///
/// 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`
/// was sent. Note that the fact that an async operation has been created
/// does not mean that is has been polled or is being polled. This information
/// is reflected in the `Stats` of the operation.
#[prost(message, repeated, tag="1")]
#[prost(message, repeated, tag = "1")]
pub new_async_ops: ::prost::alloc::vec::Vec<AsyncOp>,
/// Any async op stats that have changed since the last update.
#[prost(map="uint64, message", tag="2")]
#[prost(map = "uint64, message", tag = "2")]
pub stats_update: ::std::collections::HashMap<u64, Stats>,
/// A count of how many async op events (e.g. polls, creation, etc) were not
/// recorded because the application's event buffer was at capacity.
Expand All @@ -23,32 +24,33 @@ pub struct AsyncOpUpdate {
///
/// If the application's instrumentation ensures reliable delivery of events,
/// this will always be 0.
#[prost(uint64, tag="3")]
#[prost(uint64, tag = "3")]
pub dropped_events: u64,
}
/// An async operation.
///
/// An async operation is an operation that is associated with a resource
/// This could, for example, be a 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.
///
/// This uniquely identifies this op across all *currently live*
/// ones.
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<super::common::Id>,
/// The numeric ID of the op's `Metadata`.
///
/// This identifies the `Metadata` that describes the `tracing` span
/// corresponding to this async op. The metadata for this ID will have been sent
/// in a prior `RegisterMetadata` message.
#[prost(message, optional, tag="2")]
#[prost(message, optional, tag = "2")]
pub metadata: ::core::option::Option<super::common::MetaId>,
/// The source of this async operation. Most commonly this should be the name
/// of the method where the instantiation of this op has happened.
#[prost(string, tag="3")]
#[prost(string, tag = "3")]
pub source: ::prost::alloc::string::String,
/// The ID of the parent async op.
///
Expand All @@ -58,28 +60,29 @@ pub struct AsyncOp {
///
/// This field can be empty; if it is empty, this async op is not a child of another
/// async op.
#[prost(message, optional, tag="4")]
#[prost(message, optional, tag = "4")]
pub parent_async_op_id: ::core::option::Option<super::common::Id>,
/// The resources's ID.
#[prost(message, optional, tag="5")]
#[prost(message, optional, tag = "5")]
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.
#[prost(message, optional, tag="1")]
#[prost(message, optional, tag = "1")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// Timestamp of when the async op was dropped.
#[prost(message, optional, tag="2")]
#[prost(message, optional, tag = "2")]
pub dropped_at: ::core::option::Option<::prost_types::Timestamp>,
/// The Id of the task that is awaiting on this op.
#[prost(message, optional, tag="4")]
#[prost(message, optional, tag = "4")]
pub task_id: ::core::option::Option<super::common::Id>,
/// Contains the operation poll stats.
#[prost(message, optional, tag="5")]
#[prost(message, optional, tag = "5")]
pub poll_stats: ::core::option::Option<super::common::PollStats>,
/// State attributes of the async op.
#[prost(message, repeated, tag="6")]
#[prost(message, repeated, tag = "6")]
pub attributes: ::prost::alloc::vec::Vec<super::common::Attribute>,
}
Loading

0 comments on commit b70c1d8

Please sign in to comment.