chore: dependencies updated

This commit is contained in:
Jack Wills
2025-08-15 09:05:27 +00:00
parent 50edbc0cc0
commit ced885e012
7 changed files with 424 additions and 416 deletions
Generated
+141 -128
View File
@@ -40,9 +40,9 @@ dependencies = [
[[package]] [[package]]
name = "anstream" name = "anstream"
version = "0.6.19" version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"anstyle-parse", "anstyle-parse",
@@ -70,35 +70,35 @@ dependencies = [
[[package]] [[package]]
name = "anstyle-query" name = "anstyle-query"
version = "1.1.3" version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
dependencies = [ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
name = "anstyle-wincon" name = "anstyle-wincon"
version = "3.0.9" version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"once_cell_polyfill", "once_cell_polyfill",
"windows-sys 0.59.0", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.98" version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100"
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.4.0" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]] [[package]]
name = "backtrace" name = "backtrace"
@@ -129,9 +129,9 @@ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
[[package]] [[package]]
name = "bollard" name = "bollard"
version = "0.18.1" version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97ccca1260af6a459d75994ad5acc1651bcabcbdbc41467cc9786519ab854c30" checksum = "8796b390a5b4c86f9f2e8173a68c2791f4fa6b038b84e96dbc01c016d1e6722c"
dependencies = [ dependencies = [
"base64", "base64",
"bollard-stubs", "bollard-stubs",
@@ -162,20 +162,21 @@ dependencies = [
[[package]] [[package]]
name = "bollard-stubs" name = "bollard-stubs"
version = "1.47.1-rc.27.3.1" version = "1.49.0-rc.28.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f179cfbddb6e77a5472703d4b30436bff32929c0aa8a9008ecf23d1d3cdd0da" checksum = "2e7814991259013d5a5bee4ae28657dae0747d843cf06c40f7fc0c2894d6fa38"
dependencies = [ dependencies = [
"serde", "serde",
"serde_json",
"serde_repr", "serde_repr",
"serde_with", "serde_with",
] ]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.18.1" version = "3.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
[[package]] [[package]]
name = "bytes" name = "bytes"
@@ -197,18 +198,18 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]] [[package]]
name = "castaway" name = "castaway"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"
dependencies = [ dependencies = [
"rustversion", "rustversion",
] ]
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.27" version = "1.2.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" checksum = "2352e5597e9c544d5e6d9c95190d5d27738ade584fa8db0a16e130e5c2b5296e"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@@ -234,9 +235,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.40" version = "4.5.45"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@@ -244,9 +245,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.40" version = "4.5.44"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@@ -258,9 +259,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.40" version = "4.5.45"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@@ -349,7 +350,7 @@ dependencies = [
"document-features", "document-features",
"mio", "mio",
"parking_lot", "parking_lot",
"rustix 1.0.7", "rustix 1.0.8",
"signal-hook", "signal-hook",
"signal-hook-mio", "signal-hook-mio",
"winapi", "winapi",
@@ -473,9 +474,9 @@ dependencies = [
[[package]] [[package]]
name = "dyn-clone" name = "dyn-clone"
version = "1.0.19" version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
[[package]] [[package]]
name = "either" name = "either"
@@ -497,12 +498,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]] [[package]]
name = "errno" name = "errno"
version = "0.3.12" version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.59.0", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
@@ -615,9 +616,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.15.4" version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [ dependencies = [
"allocator-api2", "allocator-api2",
"equivalent", "equivalent",
@@ -719,9 +720,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper-util" name = "hyper-util"
version = "0.1.14" version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@@ -903,12 +904,12 @@ dependencies = [
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.9.0" version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.15.4", "hashbrown 0.15.5",
"serde", "serde",
] ]
@@ -931,9 +932,9 @@ dependencies = [
[[package]] [[package]]
name = "instability" name = "instability"
version = "0.3.7" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" checksum = "435d80800b936787d62688c927b6490e887c7ef5ff9ce922c6c6050fca75eb9a"
dependencies = [ dependencies = [
"darling", "darling",
"indoc", "indoc",
@@ -942,6 +943,17 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "io-uring"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
dependencies = [
"bitflags",
"cfg-if",
"libc",
]
[[package]] [[package]]
name = "is_terminal_polyfill" name = "is_terminal_polyfill"
version = "1.70.1" version = "1.70.1"
@@ -1023,15 +1035,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.174" version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]] [[package]]
name = "libredox" name = "libredox"
version = "0.1.3" version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"libc", "libc",
@@ -1057,9 +1069,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
[[package]] [[package]]
name = "litrs" name = "litrs"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
@@ -1083,7 +1095,7 @@ version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
dependencies = [ dependencies = [
"hashbrown 0.15.4", "hashbrown 0.15.5",
] ]
[[package]] [[package]]
@@ -1285,9 +1297,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.95" version = "1.0.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" checksum = "d61789d7719defeb74ea5fe81f2fdfdbd28a803847077cecce2ff14e1472f6f1"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -1309,9 +1321,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.9.1" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [ dependencies = [
"rand_chacha", "rand_chacha",
"rand_core", "rand_core",
@@ -1359,18 +1371,18 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.13" version = "0.5.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
[[package]] [[package]]
name = "redox_users" name = "redox_users"
version = "0.5.0" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
dependencies = [ dependencies = [
"getrandom 0.2.16", "getrandom 0.2.16",
"libredox", "libredox",
@@ -1399,9 +1411,9 @@ dependencies = [
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.25" version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
[[package]] [[package]]
name = "rustix" name = "rustix"
@@ -1418,22 +1430,22 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "1.0.7" version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.9.4", "linux-raw-sys 0.9.4",
"windows-sys 0.59.0", "windows-sys 0.60.2",
] ]
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.21" version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]] [[package]]
name = "ryu" name = "ryu"
@@ -1453,6 +1465,18 @@ dependencies = [
"serde_json", "serde_json",
] ]
[[package]]
name = "schemars"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
dependencies = [
"dyn-clone",
"ref-cast",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.2.0" version = "1.2.0"
@@ -1481,9 +1505,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.140" version = "1.0.142"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@@ -1515,9 +1539,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_spanned" name = "serde_spanned"
version = "0.6.9" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@@ -1536,16 +1560,17 @@ dependencies = [
[[package]] [[package]]
name = "serde_with" name = "serde_with"
version = "3.13.0" version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf65a400f8f66fb7b0552869ad70157166676db75ed8181f8104ea91cf9d0b42" checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5"
dependencies = [ dependencies = [
"base64", "base64",
"chrono", "chrono",
"hex", "hex",
"indexmap 1.9.3", "indexmap 1.9.3",
"indexmap 2.9.0", "indexmap 2.10.0",
"schemars", "schemars 0.9.0",
"schemars 1.0.4",
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
@@ -1590,9 +1615,9 @@ dependencies = [
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
version = "1.4.5" version = "1.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@@ -1605,9 +1630,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
[[package]] [[package]]
name = "slab" name = "slab"
version = "0.4.10" version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
[[package]] [[package]]
name = "smallvec" name = "smallvec"
@@ -1617,12 +1642,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.5.10" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -1667,9 +1692,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.103" version = "2.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" checksum = "7bc3fcb250e53458e712715cf74285c1f889686520d79294a9ef3bd7aa1fc619"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -1689,18 +1714,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.12" version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" checksum = "0b0949c3a6c842cbde3f1686d6eea5a010516deb7085f79db747562d4102f41e"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.12" version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" checksum = "cc5b44b4ab9c2fdd0e0512e6bece8388e214c0749f5862b114cc5b7a25daf227"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -1759,20 +1784,22 @@ dependencies = [
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.45.1" version = "1.47.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"io-uring",
"libc", "libc",
"mio", "mio",
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",
"slab",
"socket2", "socket2",
"tokio-macros", "tokio-macros",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@@ -1788,9 +1815,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-util" name = "tokio-util"
version = "0.7.15" version = "0.7.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@@ -1801,35 +1828,32 @@ dependencies = [
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.8.23" version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8"
dependencies = [ dependencies = [
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
"toml_edit", "toml_parser",
"winnow",
] ]
[[package]] [[package]]
name = "toml_datetime" name = "toml_datetime"
version = "0.6.11" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
dependencies = [ dependencies = [
"serde", "serde",
] ]
[[package]] [[package]]
name = "toml_edit" name = "toml_parser"
version = "0.22.27" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10"
dependencies = [ dependencies = [
"indexmap 2.9.0",
"serde",
"serde_spanned",
"toml_datetime",
"winnow", "winnow",
] ]
@@ -1968,9 +1992,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.17.0" version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be"
dependencies = [ dependencies = [
"getrandom 0.3.3", "getrandom 0.3.3",
"js-sys", "js-sys",
@@ -2147,15 +2171,6 @@ dependencies = [
"windows-link", "windows-link",
] ]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.6",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.59.0" version = "0.59.0"
@@ -2171,7 +2186,7 @@ version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [ dependencies = [
"windows-targets 0.53.2", "windows-targets 0.53.3",
] ]
[[package]] [[package]]
@@ -2192,10 +2207,11 @@ dependencies = [
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.53.2" version = "0.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
dependencies = [ dependencies = [
"windows-link",
"windows_aarch64_gnullvm 0.53.0", "windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0", "windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0", "windows_i686_gnu 0.53.0",
@@ -2304,12 +2320,9 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.7.11" version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "wit-bindgen-rt" name = "wit-bindgen-rt"
@@ -2352,18 +2365,18 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.25" version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.25" version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2404,9 +2417,9 @@ dependencies = [
[[package]] [[package]]
name = "zerovec" name = "zerovec"
version = "0.11.2" version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b"
dependencies = [ dependencies = [
"yoke", "yoke",
"zerofrom", "zerofrom",
+4 -4
View File
@@ -27,7 +27,7 @@ similar_names = "allow"
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
bollard = "0.18" bollard = "0.19"
cansi = "2.2" cansi = "2.2"
clap = { version = "4.5", features = ["color", "derive", "unicode"] } clap = { version = "4.5", features = ["color", "derive", "unicode"] }
crossterm = "0.29" crossterm = "0.29"
@@ -39,12 +39,12 @@ ratatui = "0.29"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
serde_jsonc = "1.0" serde_jsonc = "1.0"
tokio = { version = "1.45", features = ["full"] } tokio = { version = "1.47", features = ["full"] }
tokio-util = "0.7" tokio-util = "0.7"
toml = { version = "0.8", default-features = false, features = ["parse"] } toml = { version = "0.9", default-features = false, features = ["parse", "serde"] }
tracing = "0.1" tracing = "0.1"
tracing-subscriber = "0.3" tracing-subscriber = "0.3"
uuid = { version = "1.17", features = ["fast-rng", "v4"] } uuid = { version = "1.18", features = ["fast-rng", "v4"] }
[profile.release] [profile.release]
lto = true lto = true
+84 -35
View File
@@ -7,7 +7,12 @@ use std::{
use bollard::service::Port; use bollard::service::Port;
use jiff::{Timestamp, tz::TimeZone}; use jiff::{Timestamp, tz::TimeZone};
use ratatui::{layout::Size, style::Color, text::Text, widgets::ListState}; use ratatui::{
layout::Size,
style::Color,
text::{Line, Text},
widgets::ListState,
};
use crate::config::AppColors; use crate::config::AppColors;
@@ -323,6 +328,54 @@ impl From<(&str, &ContainerStatus)> for State {
} }
} }
/// Need status, to check if container is unhealthy or not
impl
From<(
&bollard::secret::ContainerSummaryStateEnum,
&ContainerStatus,
)> for State
{
fn from(
(input, status): (
&bollard::secret::ContainerSummaryStateEnum,
&ContainerStatus,
),
) -> Self {
match input {
bollard::secret::ContainerSummaryStateEnum::DEAD => Self::Dead,
bollard::secret::ContainerSummaryStateEnum::EXITED => Self::Exited,
bollard::secret::ContainerSummaryStateEnum::PAUSED => Self::Paused,
bollard::secret::ContainerSummaryStateEnum::REMOVING => Self::Removing,
bollard::secret::ContainerSummaryStateEnum::RESTARTING => Self::Restarting,
bollard::secret::ContainerSummaryStateEnum::RUNNING => {
if status.unhealthy() {
Self::Running(RunningState::Unhealthy)
} else {
Self::Running(RunningState::Healthy)
}
}
_ => Self::Unknown,
}
}
}
/// Again, need status, to check if container is unhealthy or not
impl
From<(
Option<&bollard::secret::ContainerSummaryStateEnum>,
&ContainerStatus,
)> for State
{
fn from(
(input, status): (
Option<&bollard::secret::ContainerSummaryStateEnum>,
&ContainerStatus,
),
) -> Self {
input.map_or(Self::Unknown, |input| Self::from((input, status)))
}
}
/// Again, need status, to check if container is unhealthy or not /// Again, need status, to check if container is unhealthy or not
impl From<(Option<String>, &ContainerStatus)> for State { impl From<(Option<String>, &ContainerStatus)> for State {
fn from((input, status): (Option<String>, &ContainerStatus)) -> Self { fn from((input, status): (Option<String>, &ContainerStatus)) -> Self {
@@ -590,45 +643,41 @@ impl Logs {
/// `text` *should* only be a single line, so just use the .first() method rather than trying to iterate /// `text` *should* only be a single line, so just use the .first() method rather than trying to iterate
fn format_log_line(text: &Text<'static>, char_offset: usize, width: u16) -> Text<'static> { fn format_log_line(text: &Text<'static>, char_offset: usize, width: u16) -> Text<'static> {
let mut skipped = 0; let mut skipped = 0;
Text::from( text.lines.first().map_or_else(Text::default, |line| {
text.lines Text::from(Line::from(
.first() line.spans
.map(|line| { .iter()
ratatui::text::Line::from( .filter_map(|span| {
line.spans if skipped >= char_offset {
.iter() Some(ratatui::text::Span::styled(
.filter_map(|span| { span.content.chars().take(width.into()).collect::<String>(),
if skipped >= char_offset { span.style,
return Some(ratatui::text::Span::styled( ))
span.content.chars().take(width.into()).collect::<String>(), } else {
span.style, let span_len = span.content.chars().count();
)); if skipped + span_len <= char_offset {
} skipped += span_len;
let span_len = span.content.chars().count(); None
if skipped + span_len <= char_offset { } else {
skipped += span_len; let start_index = char_offset - skipped;
None skipped = char_offset;
} else { Some(ratatui::text::Span::styled(
let start_index = char_offset - skipped; span.content
skipped = char_offset;
let new_content = span
.content
.chars() .chars()
.skip(start_index) .skip(start_index)
.take(width.into()) .take(width.into())
.collect::<String>(); .collect::<String>(),
Some(ratatui::text::Span::styled(new_content, span.style)) span.style,
} ))
}) }
.collect::<Vec<_>>(), }
) })
}) .collect::<Vec<_>>(),
.into_iter() ))
.collect::<Vec<_>>(), })
)
} }
/// Get the logs vec, but instead of cloning to whole vec, only clone items within x of the currently selected index, as ell as only the current screen widths number of chars /// Get the logs vec, but instead of cloning to whole vec, only clone items within x of the currently selected index, as well as only the current screen widths number of chars
/// Where x is the abs different of the index plus the panel height & a padding /// Where x is the abs different of the index plus the panel height & a padding
/// Take into account the char offset, so that can scroll a line /// Take into account the char offset, so that can scroll a line
/// The rest can be just empty list items /// The rest can be just empty list items
+6 -1
View File
@@ -896,7 +896,12 @@ impl AppData {
.as_ref() .as_ref()
.map_or(String::new(), std::clone::Clone::clone), .map_or(String::new(), std::clone::Clone::clone),
); );
let state = State::from((i.state.as_ref().map_or("dead", |z| z), &status)); let state = State::from((
i.state
.as_ref()
.map_or(&bollard::secret::ContainerSummaryStateEnum::DEAD, |z| z),
&status,
));
let image = i let image = i
.image .image
.as_ref() .as_ref()
+183 -243
View File
@@ -1,9 +1,10 @@
use bollard::{ use bollard::{
Docker, Docker,
container::{ query_parameters::{
ListContainersOptions, LogsOptions, MemoryStatsStats, RemoveContainerOptions, ListContainersOptions, LogsOptions, RemoveContainerOptions, RestartContainerOptions,
StartContainerOptions, Stats, StatsOptions, StartContainerOptions, StatsOptions, StopContainerOptions,
}, },
secret::ContainerStatsResponse,
service::ContainerSummary, service::ContainerSummary,
}; };
use futures_util::StreamExt; use futures_util::StreamExt;
@@ -75,31 +76,44 @@ pub struct DockerData {
impl DockerData { impl DockerData {
/// Use docker stats to calculate current cpu usage /// Use docker stats to calculate current cpu usage
#[allow(clippy::cast_precision_loss)] #[allow(clippy::cast_precision_loss)]
fn calculate_usage(stats: &Stats) -> f64 { fn calculate_usage(stats: &ContainerStatsResponse) -> f64 {
let mut cpu_percentage = 0.0; let mut cpu_percentage = 0.0;
let cpu_delta = stats
.cpu_stats
.cpu_usage
.total_usage
.saturating_sub(stats.precpu_stats.cpu_usage.total_usage)
as f64;
if let (Some(cpu_stats_usage), Some(precpu_stats_usage)) = ( let total_usage = stats.precpu_stats.as_ref().map_or(0, |i| {
stats.cpu_stats.system_cpu_usage, i.cpu_usage
stats.precpu_stats.system_cpu_usage, .as_ref()
.map_or(0, |i| i.total_usage.unwrap_or_default())
});
let cpu_delta = stats.cpu_stats.as_ref().map_or(0, |i| {
i.cpu_usage.as_ref().map_or(0, |i| {
i.total_usage
.unwrap_or_default()
.saturating_sub(total_usage)
})
}) as f64;
if let (Some(Some(cpu_stats_usage)), Some(Some(precpu_stats_usage))) = (
stats.cpu_stats.as_ref().map(|i| i.system_cpu_usage),
stats.precpu_stats.as_ref().map(|i| i.system_cpu_usage),
) { ) {
let system_delta = cpu_stats_usage.saturating_sub(precpu_stats_usage) as f64; let system_delta = cpu_stats_usage.saturating_sub(precpu_stats_usage) as f64;
let online_cpus = stats.cpu_stats.online_cpus.unwrap_or_else(|| { let online_cpus = f64::from(stats.cpu_stats.as_ref().map_or(0, |i| {
u64::try_from( i.online_cpus.unwrap_or_else(|| {
stats u32::try_from(
.cpu_stats stats
.cpu_usage .cpu_stats
.percpu_usage .clone()
.as_ref() .unwrap_or_default()
.map_or(0, std::vec::Vec::len), .cpu_usage
) .unwrap_or_default()
.unwrap_or_default() .percpu_usage
}) as f64; .as_ref()
.map_or(0, std::vec::Vec::len),
)
.unwrap_or_default()
})
}));
if system_delta > 0.0 && cpu_delta > 0.0 { if system_delta > 0.0 && cpu_delta > 0.0 {
cpu_percentage = (cpu_delta / system_delta) * online_cpus * 100.0; cpu_percentage = (cpu_delta / system_delta) * online_cpus * 100.0;
} }
@@ -131,20 +145,23 @@ impl DockerData {
) )
.take(1); .take(1);
// some err here
while let Some(Ok(stats)) = stream.next().await { while let Some(Ok(stats)) = stream.next().await {
// Memory stats are only collected if the container is alive - is this the behaviour we want? // Memory stats are only collected if the container is alive - is this the behaviour we want?
let (mem_stat, cpu_stats) = if state.is_alive() { let (mem_stat, cpu_stats) = if state.is_alive() {
let mem_cache = stats.memory_stats.stats.map_or(0, |i| match i { let mem_cache = stats.memory_stats.as_ref().map_or(&0, |i| {
MemoryStatsStats::V1(x) => x.inactive_file, i.stats
MemoryStatsStats::V2(x) => x.inactive_file, .as_ref()
.map_or(&0, |i| i.get("inactive_file").unwrap_or(&0))
}); });
( (
Some( Some(
stats stats
.memory_stats .memory_stats
.usage .as_ref()
.unwrap_or_default() .map_or(0, |i| i.usage.unwrap_or_default())
.saturating_sub(mem_cache), .saturating_sub(*mem_cache),
), ),
Some(Self::calculate_usage(&stats)), Some(Self::calculate_usage(&stats)),
) )
@@ -152,26 +169,25 @@ impl DockerData {
(None, None) (None, None)
}; };
let op_key = stats // TODO Is hardcoded eth0 a good idea here?
.networks let (rx, tx) = stats.networks.as_ref().map_or((0, 0), |i| {
.as_ref() i.get("eth0").map_or((0, 0), |x| {
.and_then(|networks| networks.keys().next().cloned()); (
x.rx_bytes.unwrap_or_default(),
let (rx, tx) = if let Some(key) = op_key { x.tx_bytes.unwrap_or_default(),
stats )
.networks })
.unwrap_or_default() });
.get(&key)
.map_or((0, 0), |f| (f.rx_bytes, f.tx_bytes))
} else {
(0, 0)
};
app_data.lock().update_stats_by_id( app_data.lock().update_stats_by_id(
id, id,
cpu_stats, cpu_stats,
mem_stat, mem_stat,
stats.memory_stats.limit.unwrap_or_default(), stats
.memory_stats
.unwrap_or_default()
.limit
.unwrap_or_default(),
rx, rx,
tx, tx,
); );
@@ -206,7 +222,7 @@ impl DockerData {
async fn update_all_containers(&self) { async fn update_all_containers(&self) {
let containers = self let containers = self
.docker .docker
.list_containers(Some(ListContainersOptions::<String> { .list_containers(Some(ListContainersOptions {
all: true, all: true,
..Default::default() ..Default::default()
})) }))
@@ -244,11 +260,11 @@ impl DockerData {
spawns: Arc<Mutex<HashMap<SpawnId, JoinHandle<()>>>>, spawns: Arc<Mutex<HashMap<SpawnId, JoinHandle<()>>>>,
stderr: bool, stderr: bool,
) { ) {
let options = Some(LogsOptions::<String> { let options = Some(LogsOptions {
stdout: true, stdout: true,
stderr, stderr,
timestamps: true, timestamps: true,
since: i64::try_from(since).unwrap_or_default(), since: i32::try_from(since).unwrap_or_default(),
..Default::default() ..Default::default()
}); });
@@ -365,14 +381,22 @@ impl DockerData {
.await .await
} }
DockerCommand::Pause => docker.pause_container(id.get()).await, DockerCommand::Pause => docker.pause_container(id.get()).await,
DockerCommand::Restart => docker.restart_container(id.get(), None).await, DockerCommand::Restart => {
docker
.restart_container(id.get(), None::<RestartContainerOptions>)
.await
}
DockerCommand::Resume => docker.unpause_container(id.get()).await, DockerCommand::Resume => docker.unpause_container(id.get()).await,
DockerCommand::Start => { DockerCommand::Start => {
docker docker
.start_container(id.get(), None::<StartContainerOptions<String>>) .start_container(id.get(), None::<StartContainerOptions>)
.await
}
DockerCommand::Stop => {
docker
.stop_container(id.get(), None::<StopContainerOptions>)
.await .await
} }
DockerCommand::Stop => docker.stop_container(id.get(), None).await,
} }
.is_err() .is_err()
{ {
@@ -448,119 +472,72 @@ impl DockerData {
#[allow(clippy::float_cmp)] #[allow(clippy::float_cmp)]
mod tests { mod tests {
use bollard::container::{ use bollard::secret::{ContainerCpuStats, ContainerCpuUsage};
BlkioStats, CPUStats, CPUUsage, MemoryStats, PidsStats, Stats, StorageStats, ThrottlingData,
};
use super::*; use super::*;
fn gen_stats() -> Stats { fn gen_stats() -> ContainerStatsResponse {
Stats { ContainerStatsResponse {
read: String::new(), read: None,
preread: String::new(), preread: None,
num_procs: 1, num_procs: Some(1),
pids_stats: PidsStats { pids_stats: None,
current: None,
limit: None,
},
network: None,
networks: None, networks: None,
memory_stats: MemoryStats { memory_stats: None,
stats: None, blkio_stats: None,
max_usage: None, cpu_stats: Some(ContainerCpuStats {
usage: None, cpu_usage: Some(ContainerCpuUsage {
failcnt: None,
limit: None,
commit: None,
commit_peak: None,
commitbytes: None,
commitpeakbytes: None,
privateworkingset: None,
},
blkio_stats: BlkioStats {
io_service_bytes_recursive: None,
io_serviced_recursive: None,
io_queue_recursive: None,
io_service_time_recursive: None,
io_wait_time_recursive: None,
io_merged_recursive: None,
io_time_recursive: None,
sectors_recursive: None,
},
cpu_stats: CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, }),
throttled_periods: 0, precpu_stats: Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
},
precpu_stats: CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, }),
throttled_periods: 0, storage_stats: None,
throttled_time: 0, name: None,
}, id: None,
},
storage_stats: StorageStats {
read_count_normalized: None,
read_size_bytes: None,
write_count_normalized: None,
write_size_bytes: None,
},
name: String::new(),
id: String::new(),
} }
} }
#[test] #[test]
fn test_calculate_usage_50() { fn test_calculate_usage_50() {
let mut stats = gen_stats(); let mut stats = gen_stats();
stats.precpu_stats = CPUStats { stats.precpu_stats = Some(ContainerCpuStats {
cpu_usage: CPUUsage { cpu_usage: Some(ContainerCpuUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0, stats.cpu_stats = Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
};
stats.cpu_stats = CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![150]), percpu_usage: Some(vec![150]),
usage_in_usermode: 20, usage_in_usermode: Some(20),
total_usage: 150, total_usage: Some(150),
usage_in_kernelmode: 30, usage_in_kernelmode: Some(30),
}, }),
system_cpu_usage: Some(500), system_cpu_usage: Some(500),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0,
throttled_time: 0,
},
};
let cpu_percentage = DockerData::calculate_usage(&stats); let cpu_percentage = DockerData::calculate_usage(&stats);
assert_eq!(50.0, cpu_percentage); assert_eq!(50.0, cpu_percentage);
} }
@@ -568,37 +545,28 @@ mod tests {
#[test] #[test]
fn test_calculate_usage_25() { fn test_calculate_usage_25() {
let mut stats = gen_stats(); let mut stats = gen_stats();
stats.precpu_stats = CPUStats { stats.precpu_stats = Some(ContainerCpuStats {
cpu_usage: CPUUsage { cpu_usage: Some(ContainerCpuUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0, stats.cpu_stats = Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
};
stats.cpu_stats = CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![75]), percpu_usage: Some(vec![75]),
usage_in_usermode: 20, usage_in_usermode: Some(20),
total_usage: 125, total_usage: Some(125),
usage_in_kernelmode: 30, usage_in_kernelmode: Some(30),
}, }),
system_cpu_usage: Some(500), system_cpu_usage: Some(500),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0,
throttled_time: 0,
},
};
let cpu_percentage = DockerData::calculate_usage(&stats); let cpu_percentage = DockerData::calculate_usage(&stats);
assert_eq!(25.0, cpu_percentage); assert_eq!(25.0, cpu_percentage);
} }
@@ -606,38 +574,28 @@ mod tests {
#[test] #[test]
fn test_calculate_usage_75() { fn test_calculate_usage_75() {
let mut stats = gen_stats(); let mut stats = gen_stats();
stats.precpu_stats = CPUStats { stats.precpu_stats = Some(ContainerCpuStats {
cpu_usage: CPUUsage { cpu_usage: Some(ContainerCpuUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0, stats.cpu_stats = Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
};
stats.cpu_stats = CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![175]), percpu_usage: Some(vec![175]),
usage_in_usermode: 20, usage_in_usermode: Some(20),
total_usage: 175, total_usage: Some(175),
usage_in_kernelmode: 30, usage_in_kernelmode: Some(30),
}, }),
system_cpu_usage: Some(500), system_cpu_usage: Some(500),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0,
throttled_time: 0,
},
};
let cpu_percentage = DockerData::calculate_usage(&stats); let cpu_percentage = DockerData::calculate_usage(&stats);
assert_eq!(75.0, cpu_percentage); assert_eq!(75.0, cpu_percentage);
} }
@@ -645,36 +603,28 @@ mod tests {
#[test] #[test]
fn test_calculate_usage_100() { fn test_calculate_usage_100() {
let mut stats = gen_stats(); let mut stats = gen_stats();
stats.precpu_stats = CPUStats { stats.precpu_stats = Some(ContainerCpuStats {
cpu_usage: CPUUsage { cpu_usage: Some(ContainerCpuUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0, stats.cpu_stats = Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
};
stats.cpu_stats = CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![200]), percpu_usage: Some(vec![200]),
usage_in_usermode: 20, usage_in_usermode: Some(20),
total_usage: 200, total_usage: Some(200),
usage_in_kernelmode: 30, usage_in_kernelmode: Some(30),
}, }),
system_cpu_usage: Some(500), system_cpu_usage: Some(500),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0,
throttled_time: 0,
},
};
let cpu_percentage = DockerData::calculate_usage(&stats); let cpu_percentage = DockerData::calculate_usage(&stats);
assert_eq!(100.0, cpu_percentage); assert_eq!(100.0, cpu_percentage);
} }
@@ -682,38 +632,28 @@ mod tests {
#[test] #[test]
fn test_calculate_usage_175() { fn test_calculate_usage_175() {
let mut stats = gen_stats(); let mut stats = gen_stats();
stats.precpu_stats = CPUStats { stats.precpu_stats = Some(ContainerCpuStats {
cpu_usage: CPUUsage { cpu_usage: Some(ContainerCpuUsage {
percpu_usage: Some(vec![50]), percpu_usage: Some(vec![50]),
usage_in_usermode: 10, usage_in_usermode: Some(10),
total_usage: 100, total_usage: Some(100),
usage_in_kernelmode: 20, usage_in_kernelmode: Some(20),
}, }),
system_cpu_usage: Some(400), system_cpu_usage: Some(400),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0, stats.cpu_stats = Some(ContainerCpuStats {
throttled_time: 0, cpu_usage: Some(ContainerCpuUsage {
},
};
stats.cpu_stats = CPUStats {
cpu_usage: CPUUsage {
percpu_usage: Some(vec![275]), percpu_usage: Some(vec![275]),
usage_in_usermode: 20, usage_in_usermode: Some(20),
total_usage: 275, total_usage: Some(275),
usage_in_kernelmode: 30, usage_in_kernelmode: Some(30),
}, }),
system_cpu_usage: Some(500), system_cpu_usage: Some(500),
online_cpus: Some(1), online_cpus: Some(1),
throttling_data: ThrottlingData { throttling_data: None,
periods: 0, });
throttled_periods: 0,
throttled_time: 0,
},
};
let cpu_percentage = DockerData::calculate_usage(&stats); let cpu_percentage = DockerData::calculate_usage(&stats);
assert_eq!(175.0, cpu_percentage); assert_eq!(175.0, cpu_percentage);
} }
+2 -3
View File
@@ -5,8 +5,7 @@ use std::{
time::SystemTime, time::SystemTime,
}; };
use bollard::container::LogsOptions; use bollard::query_parameters::LogsOptions;
// use bollard::container::LogsOptions;
use cansi::v3::categorise_text; use cansi::v3::categorise_text;
use crossterm::{ use crossterm::{
event::{DisableMouseCapture, KeyCode, KeyModifiers, MouseButton, MouseEvent, MouseEventKind}, event::{DisableMouseCapture, KeyCode, KeyModifiers, MouseButton, MouseEvent, MouseEventKind},
@@ -188,7 +187,7 @@ impl InputHandler {
let path = log_path.join(format!("{name}_{now}.log")); let path = log_path.join(format!("{name}_{now}.log"));
let options = Some(LogsOptions::<String> { let options = Some(LogsOptions {
stderr: true, stderr: true,
stdout: true, stdout: true,
timestamps: args.show_timestamp, timestamps: args.show_timestamp,
+4 -2
View File
@@ -1,4 +1,5 @@
#![allow(clippy::collapsible_if)] #![allow(clippy::collapsible_if)]
// Zigbuild is stuck on 1.87.0, which means Mac builds won't work when using collapsible ifs
use app_data::AppData; use app_data::AppData;
use app_error::AppError; use app_error::AppError;
@@ -151,7 +152,7 @@ async fn main() {
#[allow(clippy::unwrap_used)] #[allow(clippy::unwrap_used)]
mod tests { mod tests {
use std::sync::Arc; use std::{str::FromStr, sync::Arc};
use bollard::service::{ContainerSummary, Port}; use bollard::service::{ContainerSummary, Port};
@@ -230,6 +231,7 @@ mod tests {
pub fn gen_container_summary(index: usize, state: &str) -> ContainerSummary { pub fn gen_container_summary(index: usize, state: &str) -> ContainerSummary {
ContainerSummary { ContainerSummary {
image_manifest_descriptor: None,
id: Some(format!("{index}")), id: Some(format!("{index}")),
names: Some(vec![format!("container_{}", index)]), names: Some(vec![format!("container_{}", index)]),
image: Some(format!("image_{index}")), image: Some(format!("image_{index}")),
@@ -245,7 +247,7 @@ mod tests {
size_rw: None, size_rw: None,
size_root_fs: None, size_root_fs: None,
labels: None, labels: None,
state: Some(state.to_owned()), state: Some(bollard::secret::ContainerSummaryStateEnum::from_str(state).unwrap()),
status: Some(format!("Up {index} hour")), status: Some(format!("Up {index} hour")),
host_config: None, host_config: None,
network_settings: None, network_settings: None,