diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8dc07389c..6c3500e13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,11 +25,9 @@ env: RUSTUP_MAX_RETRIES: 10 # Don't emit giant backtraces in the CI logs. RUST_BACKTRACE: short - # Make Rust 1.56.0 the minimum supported Rust version. - # - # Some of our dependencies require `edition = "2021"` which is only supported - # on 1.56.0+. - minrust: 1.56.0 + # Make 1.58 MSRV due to <=1.57 failing to build console-api due to a bug + # with cargo version resolution. + minrust: 1.58.0 jobs: check: diff --git a/Cargo.lock b/Cargo.lock index 9d3cd745a..ed268c39a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] @@ -37,15 +37,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.44" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" [[package]] name = "async-stream" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" dependencies = [ "async-stream-impl", "futures-core", @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ "proc-macro2", "quote", @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -86,15 +86,58 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5611d4977882c5af1c0f7a34d51b5d87f784f86912bb543986b014ea4995ef93" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95cd109b3e93c9541dcce5b0219dcf89169dcc58c1bebed65082808324258afb" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", +] [[package]] name = "backtrace" -version = "0.3.62" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", @@ -137,9 +180,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.71" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -149,9 +192,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.0.0" +version = "3.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17bf219fcd37199b9a29e00ba65dfb8cd5b2688b7297ec14ff829c40ac50ca9" +checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c" dependencies = [ "atty", "bitflags", @@ -166,9 +209,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.0.0" +version = "3.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b9752c030a14235a0bd5ef3ad60a1dcac8468c30921327fc8af36b20c790b9" +checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" dependencies = [ "heck", "proc-macro-error", @@ -177,6 +220,15 @@ dependencies = [ "syn", ] +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + [[package]] name = "color-eyre" version = "0.5.11" @@ -207,7 +259,7 @@ dependencies = [ [[package]] name = "console-api" -version = "0.1.2" +version = "0.2.0" dependencies = [ "prost", "prost-types", @@ -226,7 +278,7 @@ dependencies = [ "futures", "hdrhistogram", "humantime", - "parking_lot", + "parking_lot 0.11.2", "prost-types", "serde", "serde_json", @@ -236,23 +288,23 @@ dependencies = [ "tonic", "tracing", "tracing-core", - "tracing-subscriber 0.3.1", + "tracing-subscriber 0.3.10", ] [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if", "crossbeam-utils", @@ -260,9 +312,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if", "lazy_static", @@ -278,8 +330,8 @@ dependencies = [ "crossterm_winapi", "futures-core", "libc", - "mio", - "parking_lot", + "mio 0.7.14", + "parking_lot 0.11.2", "signal-hook", "signal-hook-mio", "winapi", @@ -302,19 +354,28 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "eyre" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b" +checksum = "9289ed2c0440a6536e65119725cf91fc2c6b5e513bfd2e36e1134d7cca6ca12f" dependencies = [ "indenter", "once_cell", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "fixedbitset" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "flate2" @@ -346,9 +407,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -361,9 +422,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -371,15 +432,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -388,18 +449,16 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "autocfg", - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -407,23 +466,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", @@ -433,33 +491,31 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "gimli" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "h2" -version = "0.3.7" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes", "fnv", @@ -482,9 +538,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "hdrhistogram" -version = "7.4.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6490be71f07a5f62b564bc58e36953f675833df11c7e4a0647bee7a07ca1ec5e" +checksum = "31672b7011be2c4f7456c4ddbcb40e7e9a4a9fad8efe49a6ebaf5f307d0109c0" dependencies = [ "base64", "byteorder", @@ -495,12 +551,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -513,9 +566,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes", "fnv", @@ -533,17 +586,23 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" [[package]] name = "httpdate" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humantime" @@ -553,9 +612,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.14" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes", "futures-channel", @@ -606,9 +665,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", @@ -625,18 +684,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "lazy_static" @@ -646,24 +705,25 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.105" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" +checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if", ] @@ -683,17 +743,29 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + [[package]] name = "memchr" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "minimal-lexical" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" @@ -718,6 +790,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "mio" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "miow" version = "0.3.7" @@ -735,20 +821,19 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "nom" -version = "7.0.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -764,9 +849,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -783,9 +868,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "os_str_bytes" @@ -810,7 +895,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.2", ] [[package]] @@ -827,6 +922,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "parking_lot_core" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -845,18 +953,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -865,9 +973,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -877,9 +985,19 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "prettyplease" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b83ec2d0af5c5c556257ff52c9f98934e243b9fd39604bfb2a9b75ec2e97f18" +dependencies = [ + "proc-macro2", + "syn", +] [[package]] name = "proc-macro-error" @@ -905,32 +1023,20 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] name = "prost" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +checksum = "1bd5316aa8f5c82add416dfbc25116b84b748a21153f512917e8143640a71bbd" dependencies = [ "bytes", "prost-derive", @@ -938,11 +1044,13 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +checksum = "328f9f29b82409216decb172d81e936415d21245befa79cd34c3f29d87d1c50b" dependencies = [ "bytes", + "cfg-if", + "cmake", "heck", "itertools", "lazy_static", @@ -958,9 +1066,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +checksum = "df35198f0777b75e9ff669737c6da5136b59dba33cf5a010a6d1cc4d56defc6f" dependencies = [ "anyhow", "itertools", @@ -971,9 +1079,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +checksum = "926681c118ae6e512a3ccefd4abbe5521a14f4cc1e207356d4d00c0b7f2006fd" dependencies = [ "bytes", "prost", @@ -981,23 +1089,22 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.10" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "632d02bff7f874a36f33ea8bb416cd484b90cc66c1194b1a1110d067a7013f58" dependencies = [ "proc-macro2", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", - "rand_hc", ] [[package]] @@ -1019,29 +1126,20 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -1080,9 +1178,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "scopeguard" @@ -1092,18 +1190,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -1112,9 +1210,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.68" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -1132,9 +1230,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c98891d737e271a2954825ef19e46bd16bdb98e2746f2eec4f7a4ef7946efd1" +checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" dependencies = [ "libc", "signal-hook-registry", @@ -1142,12 +1240,12 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", - "mio", + "mio 0.7.14", "signal-hook", ] @@ -1162,21 +1260,21 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1190,24 +1288,30 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.81" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] +[[package]] +name = "sync_wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", + "fastrand", "libc", - "rand", "redox_syscall", "remove_dir_all", "winapi", @@ -1215,33 +1319,33 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] [[package]] name = "tinyvec" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -1254,19 +1358,20 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes", "libc", "memchr", - "mio", + "mio 0.8.2", "num_cpus", "once_cell", - "parking_lot", + "parking_lot 0.12.0", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", "tracing", "winapi", @@ -1292,15 +1397,15 @@ dependencies = [ "tonic", "tracing", "tracing-journald", - "tracing-subscriber 0.3.1", + "tracing-subscriber 0.3.10", "tui", ] [[package]] name = "tokio-io-timeout" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ "pin-project-lite", "tokio", @@ -1319,9 +1424,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -1330,26 +1435,27 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.8" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] name = "tonic" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" +checksum = "9a1a361140b1af3f548e0a5105126b3fc737542f6cd4947b66419c80be07db22" dependencies = [ "async-stream", "async-trait", + "axum", "base64", "bytes", "futures-core", @@ -1375,10 +1481,11 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88358bb1dcfeb62dcce85c63006cafb964b7be481d522b7e09589d4d1e718d2a" +checksum = "4d17087af5c80e5d5fc8ba9878e60258065a0a757e35efe7a05b7904bece1943" dependencies = [ + "prettyplease", "proc-macro2", "prost-build", "quote", @@ -1387,9 +1494,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" +checksum = "9a89fd63ad6adf737582df5db40d286574513c69a11dac5214dc3b5603d6713e" dependencies = [ "futures-core", "futures-util", @@ -1399,13 +1506,31 @@ dependencies = [ "rand", "slab", "tokio", - "tokio-stream", "tokio-util", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "tower-http" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba3f3efabf7fb41fae8534fc20a817013dd1c12cb45441efb6c82e6556b4cd8" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.1" @@ -1420,9 +1545,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" dependencies = [ "cfg-if", "log", @@ -1433,9 +1558,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.18" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" +checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" dependencies = [ "proc-macro2", "quote", @@ -1444,11 +1569,12 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "90442985ee2f57c9e1b548ee72ae842f4a9a20e3f417cc38dbc5dc684d9bb4ee" dependencies = [ "lazy_static", + "valuable", ] [[package]] @@ -1473,12 +1599,13 @@ dependencies = [ [[package]] name = "tracing-journald" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c35f4a6b4b2d00511aa9e17d4efc74d4c3ddc5a5416f58a5de25c30bfeb0307" +checksum = "1ba49f4829f4e95702943ec6b2fad8936b369d20fa27036caf01329fb230e460" dependencies = [ + "libc", "tracing-core", - "tracing-subscriber 0.3.1", + "tracing-subscriber 0.3.10", ] [[package]] @@ -1505,14 +1632,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.1" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" +checksum = "b9df98b037d039d03400d9dd06b0f8ce05486b5f25e9a2d7d36196e142ebbc52" dependencies = [ "ansi_term", "lazy_static", "matchers", - "parking_lot", + "parking_lot 0.12.0", "regex", "sharded-slab", "smallvec", @@ -1558,9 +1685,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -1586,11 +1713,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" @@ -1608,11 +1741,17 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "which" -version = "4.2.2" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" dependencies = [ "either", "lazy_static", @@ -1649,3 +1788,46 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" diff --git a/console-api/Cargo.toml b/console-api/Cargo.toml index 8f8c3f17a..23a154baa 100644 --- a/console-api/Cargo.toml +++ b/console-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "console-api" -version = "0.1.2" +version = "0.2.0" license = "MIT" edition = "2021" rust-version = "1.56.0" @@ -29,20 +29,20 @@ keywords = [ transport = ["tonic-build/transport", "tonic/transport"] [dependencies] -tonic = { version = "0.6", default-features = false, features = [ +tonic = { version = "0.7", default-features = false, features = [ "prost", "codegen", + "transport", ] } -prost = "0.9" -prost-types = "0.9" +prost = "0.10" +prost-types = "0.10" tracing-core = "0.1.17" -[build-dependencies] -tonic-build = { version = "0.6", default-features = false, features = [ - "prost", +[dev-dependencies] +tonic-build = { version = "0.7", default-features = false, features = [ + "prost", "transport" ] } - [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] \ No newline at end of file diff --git a/console-api/build.rs b/console-api/build.rs deleted file mode 100644 index faee7fe83..000000000 --- a/console-api/build.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::error::Error; - -fn main() -> Result<(), Box> { - let iface_files = &[ - "proto/trace.proto", - "proto/common.proto", - "proto/tasks.proto", - "proto/instrument.proto", - "proto/resources.proto", - "proto/async_ops.proto", - ]; - let dirs = &["proto"]; - - tonic_build::configure() - .build_client(true) - .build_server(true) - .protoc_arg("--experimental_allow_proto3_optional") - .compile(iface_files, dirs)?; - - // recompile protobufs only if any of the proto files changes. - for file in iface_files { - println!("cargo:rerun-if-changed={}", file); - } - - Ok(()) -} diff --git a/console-api/src/async_ops.rs b/console-api/src/async_ops.rs index 9a1c57dd0..a91cf8d0c 100644 --- a/console-api/src/async_ops.rs +++ b/console-api/src/async_ops.rs @@ -1 +1 @@ -tonic::include_proto!("rs.tokio.console.async_ops"); +include!("generated/rs.tokio.console.async_ops.rs"); diff --git a/console-api/src/common.rs b/console-api/src/common.rs index 5d4d33cd6..211d70ba4 100644 --- a/console-api/src/common.rs +++ b/console-api/src/common.rs @@ -1,7 +1,7 @@ use std::fmt; use std::hash::{Hash, Hasher}; -tonic::include_proto!("rs.tokio.console.common"); +include!("generated/rs.tokio.console.common.rs"); impl From for metadata::Level { fn from(level: tracing_core::Level) -> Self { diff --git a/console-api/src/generated/rs.tokio.console.async_ops.rs b/console-api/src/generated/rs.tokio.console.async_ops.rs new file mode 100644 index 000000000..fb2613540 --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.async_ops.rs @@ -0,0 +1,85 @@ +/// An `AsyncOp` state update. +/// +/// 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. +#[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")] + pub new_async_ops: ::prost::alloc::vec::Vec, + /// Any async op stats that have changed since the last update. + #[prost(map="uint64, message", tag="2")] + pub stats_update: ::std::collections::HashMap, + /// 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. + /// + /// If everything is working normally, this should be 0. If it is greater + /// than 0, that may indicate that some data is missing from this update, and + /// it may be necessary to increase the number of events buffered by the + /// application to ensure that data loss is avoided. + /// + /// If the application's instrumentation ensures reliable delivery of events, + /// this will always be 0. + #[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. +#[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")] + pub id: ::core::option::Option, + /// 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")] + pub metadata: ::core::option::Option, + /// 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")] + pub source: ::prost::alloc::string::String, + /// The ID of the parent async op. + /// + /// This field is only set if this async op was created while inside of another + /// async op. For example, `tokio::sync`'s `Mutex::lock` internally calls + /// `Semaphore::acquire`. + /// + /// 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")] + pub parent_async_op_id: ::core::option::Option, + /// The resources's ID. + #[prost(message, optional, tag="5")] + pub resource_id: ::core::option::Option, +} +/// Statistics associated with a given async operation. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Stats { + /// Timestamp of when the async op has been created. + #[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")] + 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")] + pub task_id: ::core::option::Option, + /// Contains the operation poll stats. + #[prost(message, optional, tag="5")] + pub poll_stats: ::core::option::Option, + /// State attributes of the async op. + #[prost(message, repeated, tag="6")] + pub attributes: ::prost::alloc::vec::Vec, +} diff --git a/console-api/src/generated/rs.tokio.console.common.rs b/console-api/src/generated/rs.tokio.console.common.rs new file mode 100644 index 000000000..d9a77c8d3 --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.common.rs @@ -0,0 +1,252 @@ +/// Unique identifier for each task. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Id { + /// The unique identifier's concrete value. + #[prost(uint64, tag="1")] + pub id: u64, +} +/// A Rust source code location. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Location { + /// The file path + #[prost(string, optional, tag="1")] + pub file: ::core::option::Option<::prost::alloc::string::String>, + /// The Rust module path + #[prost(string, optional, tag="2")] + pub module_path: ::core::option::Option<::prost::alloc::string::String>, + /// The line number in the source code file. + #[prost(uint32, optional, tag="3")] + pub line: ::core::option::Option, + /// The character in `line`. + #[prost(uint32, optional, tag="4")] + pub column: ::core::option::Option, +} +/// Unique identifier for metadata. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetaId { + /// The unique identifier's concrete value. + #[prost(uint64, tag="1")] + pub id: u64, +} +/// Unique identifier for spans. +#[derive(Clone, 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` +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Field { + /// Metadata for the task span that the field came from. + #[prost(message, optional, tag="8")] + pub metadata_id: ::core::option::Option, + /// The key of the key-value pair. + /// + /// This is either represented as a string, or as an index into a `Metadata`'s + /// array of field name strings. + #[prost(oneof="field::Name", tags="1, 2")] + pub name: ::core::option::Option, + /// The value of the key-value pair. + #[prost(oneof="field::Value", tags="3, 4, 5, 6, 7")] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `Field`. +pub mod field { + /// The key of the key-value pair. + /// + /// This is either represented as a string, or as an index into a `Metadata`'s + /// array of field name strings. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Name { + /// The string representation of the name. + #[prost(string, tag="1")] + StrName(::prost::alloc::string::String), + /// An index position into the `Metadata.field_names` of the metadata + /// for the task span that the field came from. + #[prost(uint64, tag="2")] + NameIdx(u64), + } + /// The value of the key-value pair. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Value { + /// A value serialized to a string using `fmt::Debug`. + #[prost(string, tag="3")] + DebugVal(::prost::alloc::string::String), + /// A string value. + #[prost(string, tag="4")] + StrVal(::prost::alloc::string::String), + /// An unsigned integer value. + #[prost(uint64, tag="5")] + U64Val(u64), + /// A signed integer value. + #[prost(sint64, tag="6")] + I64Val(i64), + /// A boolean value. + #[prost(bool, tag="7")] + BoolVal(bool), + } +} +/// Represents a period of time in which a program was executing in a particular context. +/// +/// Corresponds to `Span` in the `tracing` crate. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Span { + /// An Id that uniquely identifies it in relation to other spans. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// Identifier for metadata describing static characteristics of all spans originating + /// from that callsite, such as its name, source code location, verbosity level, and + /// the names of its fields. + #[prost(message, optional, tag="2")] + pub metadata_id: ::core::option::Option, + /// User-defined key-value pairs of arbitrary data that describe the context the span represents, + #[prost(message, repeated, tag="3")] + pub fields: ::prost::alloc::vec::Vec, + /// Timestamp for the span. + #[prost(message, optional, tag="4")] + pub at: ::core::option::Option<::prost_types::Timestamp>, +} +/// Any new metadata that was registered since the last update. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterMetadata { + /// The new metadata that was registered since the last update. + #[prost(message, repeated, tag="1")] + pub metadata: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `RegisterMetadata`. +pub mod register_metadata { + /// One metadata element registered since the last update. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct NewMetadata { + /// Unique identifier for `metadata`. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// The metadata payload. + #[prost(message, optional, tag="2")] + pub metadata: ::core::option::Option, + } +} +/// Metadata associated with a span or event. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Metadata { + /// The name of the span or event. + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// Describes the part of the system where the span or event that this + /// metadata describes occurred. + #[prost(string, tag="2")] + pub target: ::prost::alloc::string::String, + /// The path to the Rust module where the span occurred. + #[prost(string, tag="3")] + pub module_path: ::prost::alloc::string::String, + /// The Rust source location associated with the span or event. + #[prost(message, optional, tag="4")] + pub location: ::core::option::Option, + /// Indicates whether metadata is associated with a span or with an event. + #[prost(enumeration="metadata::Kind", tag="5")] + pub kind: i32, + /// Describes the level of verbosity of a span or event. + #[prost(enumeration="metadata::Level", tag="6")] + pub level: i32, + /// The names of the key-value fields attached to the + /// span or event this metadata is associated with. + #[prost(string, repeated, tag="7")] + pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Nested message and enum types in `Metadata`. +pub mod metadata { + /// Indicates whether metadata is associated with a span or with an event. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Kind { + /// Indicates metadata is associated with a span. + Span = 0, + /// Indicates metadata is associated with an event. + Event = 1, + } + /// Describes the level of verbosity of a span or event. + /// + /// Corresponds to `Level` in the `tracing` crate. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Level { + /// The "error" level. + /// + /// Designates very serious errors. + Error = 0, + /// The "warn" level. + /// + /// Designates hazardous situations. + Warn = 1, + /// The "info" level. + /// Designates useful information. + Info = 2, + /// The "debug" level. + /// + /// Designates lower priority information. + Debug = 3, + /// The "trace" level. + /// + /// Designates very low priority, often extremely verbose, information. + Trace = 4, + } +} +/// 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 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PollStats { + /// The total number of times this object has been polled. + #[prost(uint64, tag="1")] + pub polls: u64, + /// The timestamp of the first time this object was polled. + /// + /// If this is `None`, the object has not yet been polled. + /// + /// Subtracting this timestamp from `created_at` can be used to calculate the + /// time to first poll for this object, a measurement of executor latency. + #[prost(message, optional, tag="3")] + pub first_poll: ::core::option::Option<::prost_types::Timestamp>, + /// The timestamp of the most recent time this objects's poll method was invoked. + /// + /// If this is `None`, the object has not yet been polled. + /// + /// If the object has only been polled a single time, then this value may be + /// equal to the `first_poll` timestamp. + /// + #[prost(message, optional, tag="4")] + pub last_poll_started: ::core::option::Option<::prost_types::Timestamp>, + /// The timestamp of the most recent time this objects's poll method finished execution. + /// + /// If this is `None`, the object has not yet been polled or is currently being polled. + /// + /// If the object does not exist anymore, then this is the time the final invocation of + /// its poll method has completed. + #[prost(message, optional, tag="5")] + pub last_poll_ended: ::core::option::Option<::prost_types::Timestamp>, + /// The total duration this object was being *actively polled*, summed across + /// all polls. Note that this includes only polls that have completed and is + /// not reflecting any inprogress polls. Subtracting `busy_time` from the + /// total lifetime of the polled object results in the amount of time it + /// has spent *waiting* to be polled. + #[prost(message, optional, tag="6")] + pub busy_time: ::core::option::Option<::prost_types::Duration>, +} +/// State attributes of an entity. These are dependent on the type of the entity. +/// +/// For example, a timer resource will have a duration, while a semaphore resource may +/// have a permit count. Likewise, the async ops of a semaphore may have attributes +/// 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. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Attribute { + /// The key-value pair for the attribute + #[prost(message, optional, tag="1")] + pub field: ::core::option::Option, + /// Some values carry a unit of measurement. For example, a duration + /// carries an associated unit of time, such as "ms" for milliseconds. + #[prost(string, optional, tag="2")] + pub unit: ::core::option::Option<::prost::alloc::string::String>, +} diff --git a/console-api/src/generated/rs.tokio.console.instrument.rs b/console-api/src/generated/rs.tokio.console.instrument.rs new file mode 100644 index 000000000..bf1f570ab --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.instrument.rs @@ -0,0 +1,497 @@ +/// InstrumentRequest requests the stream of updates +/// to observe the async runtime state over time. +/// +/// TODO: In the future allow for the request to specify +/// only the data that the caller cares about (i.e. only +/// tasks but no resources) +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InstrumentRequest { +} +/// TaskDetailsRequest requests the stream of updates about +/// the specific task identified in the request. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TaskDetailsRequest { + /// Identifies the task for which details were requested. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, +} +/// PauseRequest requests the stream of updates to pause. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PauseRequest { +} +/// ResumeRequest requests the stream of updates to resume after a pause. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResumeRequest { +} +/// Update carries all information regarding tasks, resources, async operations +/// and resource operations in one message. There are a couple of reasons to combine all +/// of these into a single message: +/// +/// - we can use one single timestamp for all the data +/// - we can have all the new_metadata in one place +/// - things such as async ops and resource ops do not make sense +/// on their own as they have relations to tasks and resources +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Update { + /// The system time when this update was recorded. + /// + /// This is the timestamp any durations in the included `Stats` were + /// calculated relative to. + #[prost(message, optional, tag="1")] + pub now: ::core::option::Option<::prost_types::Timestamp>, + /// Task state update. + #[prost(message, optional, tag="2")] + pub task_update: ::core::option::Option, + /// Resource state update. + #[prost(message, optional, tag="3")] + pub resource_update: ::core::option::Option, + /// Async operations state update + #[prost(message, optional, tag="4")] + pub async_op_update: ::core::option::Option, + /// Any new span metadata that was registered since the last update. + #[prost(message, optional, tag="5")] + pub new_metadata: ::core::option::Option, +} +/// `PauseResponse` is the value returned after a pause request. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PauseResponse { +} +/// `ResumeResponse` is the value returned after a resume request. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResumeResponse { +} +/// Generated client implementations. +pub mod instrument_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// `InstrumentServer` implements `Instrument` as a service. + #[derive(Debug, Clone)] + pub struct InstrumentClient { + inner: tonic::client::Grpc, + } + impl InstrumentClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl InstrumentClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Default + Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InstrumentClient> + where + F: tonic::service::Interceptor, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + InstrumentClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// Produces a stream of updates representing the behavior of the instrumented async runtime. + pub async fn watch_updates( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/rs.tokio.console.instrument.Instrument/WatchUpdates", + ); + self.inner.server_streaming(request.into_request(), path, codec).await + } + /// Produces a stream of updates describing the activity of a specific task. + pub async fn watch_task_details( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response< + tonic::codec::Streaming, + >, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/rs.tokio.console.instrument.Instrument/WatchTaskDetails", + ); + self.inner.server_streaming(request.into_request(), path, codec).await + } + /// Registers that the console observer wants to pause the stream. + pub async fn pause( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/rs.tokio.console.instrument.Instrument/Pause", + ); + self.inner.unary(request.into_request(), path, codec).await + } + /// Registers that the console observer wants to resume the stream. + pub async fn resume( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/rs.tokio.console.instrument.Instrument/Resume", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +pub mod instrument_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with InstrumentServer. + #[async_trait] + pub trait Instrument: Send + Sync + 'static { + ///Server streaming response type for the WatchUpdates method. + type WatchUpdatesStream: futures_core::Stream< + Item = Result, + > + + Send + + 'static; + /// Produces a stream of updates representing the behavior of the instrumented async runtime. + async fn watch_updates( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + ///Server streaming response type for the WatchTaskDetails method. + type WatchTaskDetailsStream: futures_core::Stream< + Item = Result, + > + + Send + + 'static; + /// Produces a stream of updates describing the activity of a specific task. + async fn watch_task_details( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Registers that the console observer wants to pause the stream. + async fn pause( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + /// Registers that the console observer wants to resume the stream. + async fn resume( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// `InstrumentServer` implements `Instrument` as a service. + #[derive(Debug)] + pub struct InstrumentServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl InstrumentServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for InstrumentServer + where + T: Instrument, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/rs.tokio.console.instrument.Instrument/WatchUpdates" => { + #[allow(non_camel_case_types)] + struct WatchUpdatesSvc(pub Arc); + impl< + T: Instrument, + > tonic::server::ServerStreamingService + for WatchUpdatesSvc { + type Response = super::Update; + type ResponseStream = T::WatchUpdatesStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).watch_updates(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WatchUpdatesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rs.tokio.console.instrument.Instrument/WatchTaskDetails" => { + #[allow(non_camel_case_types)] + struct WatchTaskDetailsSvc(pub Arc); + impl< + T: Instrument, + > tonic::server::ServerStreamingService + for WatchTaskDetailsSvc { + type Response = super::super::tasks::TaskDetails; + type ResponseStream = T::WatchTaskDetailsStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).watch_task_details(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WatchTaskDetailsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rs.tokio.console.instrument.Instrument/Pause" => { + #[allow(non_camel_case_types)] + struct PauseSvc(pub Arc); + impl tonic::server::UnaryService + for PauseSvc { + type Response = super::PauseResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).pause(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PauseSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/rs.tokio.console.instrument.Instrument/Resume" => { + #[allow(non_camel_case_types)] + struct ResumeSvc(pub Arc); + impl tonic::server::UnaryService + for ResumeSvc { + type Response = super::ResumeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).resume(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ResumeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for InstrumentServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::transport::NamedService for InstrumentServer { + const NAME: &'static str = "rs.tokio.console.instrument.Instrument"; + } +} diff --git a/console-api/src/generated/rs.tokio.console.resources.rs b/console-api/src/generated/rs.tokio.console.resources.rs new file mode 100644 index 000000000..10c014758 --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.resources.rs @@ -0,0 +1,138 @@ +/// A resource state update. +/// +/// Each `ResourceUpdate` contains any resource data that has changed since the last +/// update. This includes: +/// - any new resources that were created since the last update +/// - the current stats for any resource whose stats changed since the last update +/// - any new poll ops that have been invoked on a resource +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ResourceUpdate { + /// A list of new resources that were created since the last `ResourceUpdate` was + /// sent. + #[prost(message, repeated, tag="1")] + pub new_resources: ::prost::alloc::vec::Vec, + /// Any resource stats that have changed since the last update. + #[prost(map="uint64, message", tag="2")] + pub stats_update: ::std::collections::HashMap, + /// A list of all new poll ops that have been invoked on resources since the last update. + #[prost(message, repeated, tag="3")] + pub new_poll_ops: ::prost::alloc::vec::Vec, + /// A count of how many resource events (e.g. polls, creation, etc) were not + /// recorded because the application's event buffer was at capacity. + /// + /// If everything is working normally, this should be 0. If it is greater + /// than 0, that may indicate that some data is missing from this update, and + /// it may be necessary to increase the number of events buffered by the + /// application to ensure that data loss is avoided. + /// + /// If the application's instrumentation ensures reliable delivery of events, + /// this will always be 0. + #[prost(uint64, tag="4")] + pub dropped_events: u64, +} +/// Static data recorded when a new resource is created. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Resource { + /// The resources's ID. + /// + /// This uniquely identifies this resource across all *currently live* + /// resources. This is also the primary way any operations on a resource + /// are associated with it + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// The numeric ID of the resources's `Metadata`. + #[prost(message, optional, tag="2")] + pub metadata: ::core::option::Option, + /// The resources's concrete rust type. + #[prost(string, tag="3")] + pub concrete_type: ::prost::alloc::string::String, + /// The kind of resource (e.g timer, mutex) + #[prost(message, optional, tag="4")] + pub kind: ::core::option::Option, + /// The location in code where the resource was created. + #[prost(message, optional, tag="5")] + pub location: ::core::option::Option, + /// The ID of the parent resource. + #[prost(message, optional, tag="6")] + pub parent_resource_id: ::core::option::Option, + /// Is the resource an internal component of another resource? + /// + /// For example, a `tokio::time::Interval` resource might contain a + /// `tokio::time::Sleep` resource internally. + #[prost(bool, tag="7")] + pub is_internal: bool, +} +/// Nested message and enum types in `Resource`. +pub mod resource { + /// The kind of resource (e.g. timer, mutex). + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Kind { + /// Every resource is either a known kind or an other (unknown) kind. + #[prost(oneof="kind::Kind", tags="1, 2")] + pub kind: ::core::option::Option, + } + /// Nested message and enum types in `Kind`. + pub mod kind { + /// `Known` collects the kinds of resources that are known in this version of the API. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Known { + /// `TIMER` signals that this is a timer resource, e.g. waiting for a sleep to finish. + Timer = 0, + } + /// Every resource is either a known kind or an other (unknown) kind. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Kind { + /// `known` signals that this kind of resource is known to the console API. + #[prost(enumeration="Known", tag="1")] + Known(i32), + /// `other` signals that this kind of resource is unknown to the console API. + #[prost(string, tag="2")] + Other(::prost::alloc::string::String), + } + } +} +/// Task runtime stats of a resource. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Stats { + /// Timestamp of when the resource was created. + #[prost(message, optional, tag="1")] + pub created_at: ::core::option::Option<::prost_types::Timestamp>, + /// Timestamp of when the resource was dropped. + #[prost(message, optional, tag="2")] + pub dropped_at: ::core::option::Option<::prost_types::Timestamp>, + /// State attributes of the resource. These are dependent on the type of the resource. + /// For example, a timer resource will have a duration while a semaphore resource may + /// have permits as an attribute. These values may change over time as the state of + /// the resource changes. Therefore, they live in the runtime stats rather than the + /// static data describing the resource. + #[prost(message, repeated, tag="3")] + pub attributes: ::prost::alloc::vec::Vec, +} +/// A `PollOp` describes each poll operation that completes within the async +/// application. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PollOp { + /// The numeric ID of the op's `Metadata`. + /// + /// This identifies the `Metadata` that describes the `tracing` span + /// corresponding to this op. The metadata for this ID will have been sent + /// in a prior `RegisterMetadata` message. + #[prost(message, optional, tag="2")] + pub metadata: ::core::option::Option, + /// The resources's ID. + #[prost(message, optional, tag="3")] + pub resource_id: ::core::option::Option, + /// the name of this op (e.g. poll_elapsed, new_timeout, reset, etc.) + #[prost(string, tag="4")] + pub name: ::prost::alloc::string::String, + /// Identifies the task context that this poll op has been called from. + #[prost(message, optional, tag="5")] + pub task_id: ::core::option::Option, + /// Identifies the async op ID that this poll op is part of. + #[prost(message, optional, tag="6")] + pub async_op_id: ::core::option::Option, + /// Whether this poll op has returned with ready or pending. + #[prost(bool, tag="7")] + pub is_ready: bool, +} diff --git a/console-api/src/generated/rs.tokio.console.tasks.rs b/console-api/src/generated/rs.tokio.console.tasks.rs new file mode 100644 index 000000000..5bc335c44 --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.tasks.rs @@ -0,0 +1,135 @@ +/// A task state update. +/// +/// Each `TaskUpdate` contains any task data that has changed since the last +/// update. This includes: +/// - any new tasks that were spawned since the last update +/// - the current stats for any task whose stats changed since the last update +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TaskUpdate { + /// A list of new tasks that were spawned since the last `TaskUpdate` was + /// sent. + /// + /// If this is empty, no new tasks were spawned. + #[prost(message, repeated, tag="1")] + pub new_tasks: ::prost::alloc::vec::Vec, + /// Any task stats that have changed since the last update. + /// + /// This is a map of task IDs (64-bit unsigned integers) to task stats. If a + /// task's ID is not included in this map, then its stats have *not* changed + /// since the last `TaskUpdate` in which they were present. If a task's ID + /// *is* included in this map, the corresponding value represents a complete + /// snapshot of that task's stats at in the current time window. + #[prost(map="uint64, message", tag="3")] + pub stats_update: ::std::collections::HashMap, + /// A count of how many task events (e.g. polls, spawns, etc) were not + /// recorded because the application's event buffer was at capacity. + /// + /// If everything is working normally, this should be 0. If it is greater + /// than 0, that may indicate that some data is missing from this update, and + /// it may be necessary to increase the number of events buffered by the + /// application to ensure that data loss is avoided. + /// + /// If the application's instrumentation ensures reliable delivery of events, + /// this will always be 0. + #[prost(uint64, tag="4")] + pub dropped_events: u64, +} +/// A task details update +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TaskDetails { + /// The task's ID which the details belong to. + #[prost(message, optional, tag="1")] + pub task_id: ::core::option::Option, + /// The timestamp for when the update to the task took place. + #[prost(message, optional, tag="2")] + pub now: ::core::option::Option<::prost_types::Timestamp>, + /// HdrHistogram.rs `Histogram` serialized to binary in the V2 format + #[prost(bytes="vec", optional, tag="3")] + pub poll_times_histogram: ::core::option::Option<::prost::alloc::vec::Vec>, +} +/// Data recorded when a new task is spawned. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Task { + /// The task's ID. + /// + /// This uniquely identifies this task across all *currently live* tasks. + /// When the task's stats change, or when the task completes, it will be + /// identified by this ID; if the client requires additional information + /// included in the `Task` message, it should store that data and access it + /// by ID. + #[prost(message, optional, tag="1")] + pub id: ::core::option::Option, + /// The numeric ID of the task's `Metadata`. + /// + /// This identifies the `Metadata` that describes the `tracing` span + /// corresponding to this task. The metadata for this ID will have been sent + /// in a prior `RegisterMetadata` message. + #[prost(message, optional, tag="2")] + pub metadata: ::core::option::Option, + /// The category of task this task belongs to. + #[prost(enumeration="task::Kind", tag="3")] + pub kind: i32, + /// A list of `Field` objects attached to this task. + #[prost(message, repeated, tag="4")] + pub fields: ::prost::alloc::vec::Vec, + /// An ordered list of span IDs corresponding to the `tracing` span context + /// in which this task was spawned. + /// + /// The first span ID in this list is the immediate parent, followed by that + /// span's parent, and so on. The final ID is the root span of the current + /// trace. + /// + /// If this is empty, there were *no* active spans when the task was spawned. + /// + /// These IDs may correspond to `tracing` spans which are *not* tasks, if + /// additional trace data is being collected. + #[prost(message, repeated, tag="5")] + pub parents: ::prost::alloc::vec::Vec, + /// The location in code where the task was spawned. + #[prost(message, optional, tag="6")] + pub location: ::core::option::Option, +} +/// Nested message and enum types in `Task`. +pub mod task { + /// The category of task this task belongs to. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Kind { + /// A task spawned using a runtime's standard asynchronous task spawning + /// operation (such as `tokio::task::spawn`). + Spawn = 0, + /// A task spawned via a runtime's blocking task spawning operation + /// (such as `tokio::task::spawn_blocking`). + Blocking = 1, + } +} +/// Task performance statistics. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Stats { + /// Timestamp of when the task was spawned. + #[prost(message, optional, tag="1")] + pub created_at: ::core::option::Option<::prost_types::Timestamp>, + /// Timestamp of when the task was dropped. + #[prost(message, optional, tag="2")] + pub dropped_at: ::core::option::Option<::prost_types::Timestamp>, + /// The total number of times this task has been woken over its lifetime. + #[prost(uint64, tag="3")] + pub wakes: u64, + /// The total number of times this task's waker has been cloned. + #[prost(uint64, tag="4")] + pub waker_clones: u64, + /// The total number of times this task's waker has been dropped. + #[prost(uint64, tag="5")] + pub waker_drops: u64, + /// The timestamp of the most recent time this task has been woken. + /// + /// If this is `None`, the task has not yet been woken. + #[prost(message, optional, tag="6")] + pub last_wake: ::core::option::Option<::prost_types::Timestamp>, + /// Contains task poll statistics. + #[prost(message, optional, tag="7")] + pub poll_stats: ::core::option::Option, + /// The total number of times this task has woken itself. + #[prost(uint64, tag="8")] + pub self_wakes: u64, +} diff --git a/console-api/src/generated/rs.tokio.console.trace.rs b/console-api/src/generated/rs.tokio.console.trace.rs new file mode 100644 index 000000000..ed3e98991 --- /dev/null +++ b/console-api/src/generated/rs.tokio.console.trace.rs @@ -0,0 +1,316 @@ +/// Start watching trace events with the provided filter. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WatchRequest { + /// Specifies which trace events should be streamed. + #[prost(string, tag="1")] + pub filter: ::prost::alloc::string::String, +} +/// A trace event +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TraceEvent { + /// A trace event + #[prost(oneof="trace_event::Event", tags="1, 2, 3, 4, 5, 6")] + pub event: ::core::option::Option, +} +/// Nested message and enum types in `TraceEvent`. +pub mod trace_event { + /// `RegisterThreads` signals that a new thread was registered. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct RegisterThreads { + /// `names` maps the registered thread id's to their associated name. + #[prost(map="uint64, string", tag="1")] + pub names: ::std::collections::HashMap, + } + /// `Enter` signals that a span was entered. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Enter { + /// `span_id` identifies the span that was entered. + #[prost(message, optional, tag="1")] + pub span_id: ::core::option::Option, + /// `thread_id` identifies who entered the span. + #[prost(uint64, tag="2")] + pub thread_id: u64, + /// `at` identifies when the span was entered. + #[prost(message, optional, tag="3")] + pub at: ::core::option::Option<::prost_types::Timestamp>, + } + /// `Exit` signals that a span was exited. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Exit { + /// `span_id` identifies the span that was exited. + #[prost(message, optional, tag="1")] + pub span_id: ::core::option::Option, + /// `thread_id` identifies who exited the span. + #[prost(uint64, tag="2")] + pub thread_id: u64, + /// `at` identifies when the span was exited. + #[prost(message, optional, tag="3")] + pub at: ::core::option::Option<::prost_types::Timestamp>, + } + /// `Close` signals that a span was closed. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Close { + /// `span_id` identifies the span that was closed. + #[prost(message, optional, tag="1")] + pub span_id: ::core::option::Option, + /// `at` identifies when the span was closed. + #[prost(message, optional, tag="2")] + pub at: ::core::option::Option<::prost_types::Timestamp>, + } + /// A trace event + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Event { + /// A new thread was registered. + #[prost(message, tag="1")] + RegisterThread(RegisterThreads), + /// A new span metadata was registered. + #[prost(message, tag="2")] + RegisterMetadata(super::super::common::RegisterMetadata), + /// A span was created. + #[prost(message, tag="3")] + NewSpan(super::super::common::Span), + /// A span was entered. + #[prost(message, tag="4")] + EnterSpan(Enter), + /// A span was exited. + #[prost(message, tag="5")] + ExitSpan(Exit), + /// A span was closed. + #[prost(message, tag="6")] + CloseSpan(Close), + } +} +/// Generated client implementations. +pub mod trace_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Allows observers to stream trace events for a given `WatchRequest` filter. + #[derive(Debug, Clone)] + pub struct TraceClient { + inner: tonic::client::Grpc, + } + impl TraceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl TraceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Default + Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> TraceClient> + where + F: tonic::service::Interceptor, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + TraceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with `gzip`. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_gzip(mut self) -> Self { + self.inner = self.inner.send_gzip(); + self + } + /// Enable decompressing responses with `gzip`. + #[must_use] + pub fn accept_gzip(mut self) -> Self { + self.inner = self.inner.accept_gzip(); + self + } + /// Produces a stream of trace events for the given filter. + pub async fn watch( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/rs.tokio.console.trace.Trace/Watch", + ); + self.inner.server_streaming(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +pub mod trace_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with TraceServer. + #[async_trait] + pub trait Trace: Send + Sync + 'static { + ///Server streaming response type for the Watch method. + type WatchStream: futures_core::Stream< + Item = Result, + > + + Send + + 'static; + /// Produces a stream of trace events for the given filter. + async fn watch( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /// Allows observers to stream trace events for a given `WatchRequest` filter. + #[derive(Debug)] + pub struct TraceServer { + inner: _Inner, + accept_compression_encodings: (), + send_compression_encodings: (), + } + struct _Inner(Arc); + impl TraceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + } + impl tonic::codegen::Service> for TraceServer + where + T: Trace, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/rs.tokio.console.trace.Trace/Watch" => { + #[allow(non_camel_case_types)] + struct WatchSvc(pub Arc); + impl< + T: Trace, + > tonic::server::ServerStreamingService + for WatchSvc { + type Response = super::TraceEvent; + type ResponseStream = T::WatchStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).watch(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WatchSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.server_streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for TraceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::transport::NamedService for TraceServer { + const NAME: &'static str = "rs.tokio.console.trace.Trace"; + } +} diff --git a/console-api/src/instrument.rs b/console-api/src/instrument.rs index bfd2fe0fc..3a9c6b5d6 100644 --- a/console-api/src/instrument.rs +++ b/console-api/src/instrument.rs @@ -1 +1 @@ -tonic::include_proto!("rs.tokio.console.instrument"); +include!("generated/rs.tokio.console.instrument.rs"); diff --git a/console-api/src/resources.rs b/console-api/src/resources.rs index 2fc92b71b..82956509a 100644 --- a/console-api/src/resources.rs +++ b/console-api/src/resources.rs @@ -1 +1 @@ -tonic::include_proto!("rs.tokio.console.resources"); +include!("generated/rs.tokio.console.resources.rs"); diff --git a/console-api/src/tasks.rs b/console-api/src/tasks.rs index 3d62eb420..2d4eea2bb 100644 --- a/console-api/src/tasks.rs +++ b/console-api/src/tasks.rs @@ -1 +1 @@ -tonic::include_proto!("rs.tokio.console.tasks"); +include!("generated/rs.tokio.console.tasks.rs"); diff --git a/console-api/src/trace.rs b/console-api/src/trace.rs index 8ae223e9e..0cdaa8452 100644 --- a/console-api/src/trace.rs +++ b/console-api/src/trace.rs @@ -1 +1 @@ -tonic::include_proto!("rs.tokio.console.trace"); +include!("generated/rs.tokio.console.trace.rs"); diff --git a/console-api/tests/bootstrap.rs b/console-api/tests/bootstrap.rs new file mode 100644 index 000000000..ed48c6a13 --- /dev/null +++ b/console-api/tests/bootstrap.rs @@ -0,0 +1,38 @@ +use std::{path::PathBuf, process::Command}; + +#[test] +fn bootstrap() { + let iface_files = &[ + "proto/trace.proto", + "proto/common.proto", + "proto/tasks.proto", + "proto/instrument.proto", + "proto/resources.proto", + "proto/async_ops.proto", + ]; + let dirs = &["proto"]; + + let out_dir = PathBuf::from(std::env!("CARGO_MANIFEST_DIR")) + .join("src") + .join("generated"); + + tonic_build::configure() + .build_client(true) + .build_server(true) + .protoc_arg("--experimental_allow_proto3_optional") + .out_dir(format!("{}", out_dir.display())) + .compile(iface_files, dirs) + .unwrap(); + + let status = Command::new("git") + .arg("diff") + .arg("--exit-code") + .arg("--") + .arg(format!("{}", out_dir.display())) + .status() + .unwrap(); + + if !status.success() { + panic!("You should commit the protobuf files"); + } +} diff --git a/console-subscriber/Cargo.toml b/console-subscriber/Cargo.toml index f7dc5e8b0..1c33a55fa 100644 --- a/console-subscriber/Cargo.toml +++ b/console-subscriber/Cargo.toml @@ -34,8 +34,8 @@ crossbeam-utils = "0.8.7" tokio = { version = "^1.15", features = ["sync", "time", "macros", "tracing"] } tokio-stream = "0.1" thread_local = "1.1.3" -console-api = { version = "0.1.2", path = "../console-api", features = ["transport"] } -tonic = { version = "0.6", features = ["transport"] } +console-api = { version = "0.2.0", path = "../console-api", features = ["transport"] } +tonic = { version = "0.7", features = ["transport"] } tracing-core = "0.1.18" tracing = "0.1.26" tracing-subscriber = { version = "0.3.0", default-features = false, features = ["fmt", "registry"] } @@ -45,7 +45,7 @@ hdrhistogram = { version = "7.3.0", default-features = false, features = ["seria # feature to also enable `tracing-subscriber`'s parking_lot feature flag. parking_lot_crate = { package = "parking_lot", version = "0.11", optional = true } humantime = "2.1.0" -prost-types = "0.9.0" +prost-types = "0.10.0" # Required for recording: serde = { version = "1", features = ["derive"] } diff --git a/tokio-console/Cargo.toml b/tokio-console/Cargo.toml index 6e2f7347b..5fbe4181b 100644 --- a/tokio-console/Cargo.toml +++ b/tokio-console/Cargo.toml @@ -27,16 +27,16 @@ keywords = [ [dependencies] atty = "0.2" -console-api = { version = "0.1.2", path = "../console-api", features = ["transport"] } +console-api = { version = "0.2.0", path = "../console-api", features = ["transport"] } clap = { version = "3", features = ["cargo", "derive", "env"] } tokio = { version = "1", features = ["full", "rt-multi-thread"] } -tonic = { version = "0.6", features = ["transport"] } +tonic = { version = "0.7", features = ["transport"] } futures = "0.3" tui = { version = "0.16.0", default-features = false, features = ["crossterm"] } tracing = "0.1" tracing-subscriber = { version = "0.3.0", features = ["env-filter"] } tracing-journald = { version = "0.2", optional = true } -prost-types = "0.9" +prost-types = "0.10" crossterm = { version = "0.20", features = ["event-stream"] } color-eyre = { version = "0.5", features = ["issue-url"] } hdrhistogram = { version = "7.3.0", default-features = false, features = ["serialization"] }