From e038d02321b10c8957a9c010d4cd0f4c06e0e8e9 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Fri, 22 Nov 2024 10:49:16 -0800 Subject: [PATCH] Update nushell to 0.100.0 --- Cargo.lock | 126 ++++++++++++++++++++++++++++++--------------------- Cargo.toml | 6 +-- README.md | 2 +- src/query.rs | 8 ++-- 4 files changed, 82 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10c848a..801db00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,18 +146,18 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" @@ -209,9 +209,9 @@ dependencies = [ [[package]] name = "brotli" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19483b140a7ac7174d34b5a581b406c64f84da5409d3e09cf4fff604f9270e67" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -509,9 +509,9 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ "bit-set", "regex-automata", @@ -1126,9 +1126,9 @@ dependencies = [ [[package]] name = "nu-derive-value" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a025752d8cae2f96a9215b34187f4cbbe96d5df0511575fbbdb8882700877c8" +checksum = "0387af08bce4adb4444de7af0a6e14b6c84849c517e54d5d4e918314a3e36cab" dependencies = [ "heck 0.5.0", "proc-macro-error", @@ -1139,9 +1139,9 @@ dependencies = [ [[package]] name = "nu-engine" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8df223a361486eb5834f99b3c81de685342ea9f6c7eba8c40a7e4a136f64243" +checksum = "d16ba9d13364bad2f8a02db18857a1527f16d98546d609c4bf2b2dbe65fa1465" dependencies = [ "log", "nu-glob", @@ -1153,15 +1153,15 @@ dependencies = [ [[package]] name = "nu-glob" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0721c0947c445866aa34a430dd846c10b7eb34f61a390b15897e833cf0655" +checksum = "55866f2303d9aa6850258eb5acfe1ca518ed09e7ae4b1307283486b927100733" [[package]] name = "nu-path" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de17919a6834e6b773256a2f29632571473ee3c83a1530f6385c3a80d13b0564" +checksum = "91b5d3792d2cb17105986ae3d67cffc2099226140aa0b1375482ed088e767a81" dependencies = [ "dirs", "omnipath", @@ -1170,9 +1170,9 @@ dependencies = [ [[package]] name = "nu-plugin" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af5e858c58202c9cee0b0ba0d9a9c362a3fe740e949f4ebe2bd55bc3c3d56582" +checksum = "8cf7f2608bc9948100c5066eb36437baa5a395025094f116f36785a8c97bb6be" dependencies = [ "log", "nix", @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "nu-plugin-core" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6de4cbecdc9568acb9e81a6e769813f3decb97802e26fc5c66dc360f18e332" +checksum = "52f46204030fc8089d647ed5f8f35a0d2c1d9e53cddf8ac2b2c49afc072b0b30" dependencies = [ "interprocess", "log", @@ -1197,14 +1197,14 @@ dependencies = [ "rmp-serde", "serde", "serde_json", - "windows 0.54.0", + "windows 0.56.0", ] [[package]] name = "nu-plugin-protocol" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8286126f53e1cec47e02d422474bb57e743ab2aa03f37b1c78eeb5b1e0b40cec" +checksum = "9b03878c5e83dd0ee6689818e43e53a7263f76d99d5620120be124434bbfaeee" dependencies = [ "nu-protocol", "nu-utils", @@ -1216,9 +1216,9 @@ dependencies = [ [[package]] name = "nu-protocol" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdd6c9896962f3d36601668e590ccc078bfb34ea97ee3c0e3b1261d2f4dc229" +checksum = "4d091f581cd59181555c0af0f03d8216d4a6ffac1536fe3fa9e5c787c438378e" dependencies = [ "brotli", "byte-unit", @@ -1242,6 +1242,7 @@ dependencies = [ "os_pipe", "rmp-serde", "serde", + "serde_json", "thiserror", "typetag", "windows-sys 0.48.0", @@ -1249,9 +1250,9 @@ dependencies = [ [[package]] name = "nu-system" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4ff5f7b8a9a7f120d49005afdb2bb2ef3261862ca1de198ad2842896085f1b" +checksum = "eb9c3b100dcdade3151bf6a55aa85bf423551f69fc9613ff9a4092557a530fbb" dependencies = [ "chrono", "itertools", @@ -1261,19 +1262,19 @@ dependencies = [ "mach2", "nix", "ntapi", - "once_cell", "procfs", "sysinfo", - "windows 0.54.0", + "windows 0.56.0", ] [[package]] name = "nu-utils" -version = "0.99.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c781ee0f64b928c2ddc6c371a9892337874959c4c7df914687273469152d63" +checksum = "69cf489d0163494eea5a7a7fa020d8fce5a45b4032ae83427676806840765ecc" dependencies = [ "crossterm_winapi", + "fancy-regex", "log", "lscolors", "nix", @@ -1286,7 +1287,7 @@ dependencies = [ [[package]] name = "nu_plugin_prometheus" -version = "0.4.0" +version = "0.5.0" dependencies = [ "chrono", "nom", @@ -2203,17 +2204,16 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.12" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" +checksum = "e3b5ae3f4f7d64646c46c4cae4e3f01d1c5d255c7406fdd7c7f999a94e488791" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", "rayon", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] @@ -2502,12 +2502,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" @@ -2740,43 +2737,68 @@ dependencies = [ [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core 0.52.0", + "windows-core 0.54.0", "windows-targets 0.52.5", ] [[package]] name = "windows" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core 0.54.0", + "windows-core 0.56.0", "windows-targets 0.52.5", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" dependencies = [ + "windows-result", "windows-targets 0.52.5", ] [[package]] name = "windows-core" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ + "windows-implement", + "windows-interface", "windows-result", "windows-targets 0.52.5", ] +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "windows-result" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 6808a72..994539e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nu_plugin_prometheus" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Eric Hodel "] @@ -17,8 +17,8 @@ categories = ["command-line-utilities"] [dependencies] chrono = "0.4.38" nom = "7.1.3" -nu-plugin = "0.99.1" -nu-protocol = { version = "0.99.1", features = [ "plugin" ] } +nu-plugin = "0.100.0" +nu-protocol = { version = "0.100.0", features = [ "plugin" ] } prometheus-http-query = "0.8.3" reqwest = { version = "0.12.5", features = [ "native-tls" ] } tokio = { version ="1.41.1", features = [ "macros", "rt" ] } diff --git a/README.md b/README.md index f62e44a..390088a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A nushell plugin for querying prometheus Supports: -* nushell 0.99.1 +* nushell 0.100.0 * Prometheus API * Instant queries * Range queryies diff --git a/src/query.rs b/src/query.rs index b841566..687cf33 100644 --- a/src/query.rs +++ b/src/query.rs @@ -219,10 +219,10 @@ mod test { let result = query.scalar_to_value(&scalar).into_record().unwrap(); - assert_eq!(1.0, result.get("value").unwrap().as_f64().unwrap()); + assert_eq!(1.0, result.get("value").unwrap().as_float().unwrap()); assert_eq!( 1716956024, - result.get("timestamp").unwrap().as_f64().unwrap() as u64 + result.get("timestamp").unwrap().as_float().unwrap() as u64 ); } @@ -243,11 +243,11 @@ mod test { assert_eq!("job name", labels.get("job").unwrap().as_str().unwrap()); - let value = record.get("value").unwrap().as_f64().unwrap(); + let value = record.get("value").unwrap().as_float().unwrap(); assert_eq!(1.0, value); - let timestamp = record.get("timestamp").unwrap().as_f64().unwrap(); + let timestamp = record.get("timestamp").unwrap().as_float().unwrap(); assert_eq!(1716956024, timestamp as u64); }