Skip to content

Commit

Permalink
Update nushell to 0.100.0
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Nov 22, 2024
1 parent 3ff76ff commit e038d02
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 60 deletions.
126 changes: 74 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nu_plugin_prometheus"
version = "0.4.0"
version = "0.5.0"
edition = "2021"

authors = ["Eric Hodel <[email protected]>"]
Expand All @@ -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" ] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand All @@ -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);
}
Expand Down

0 comments on commit e038d02

Please sign in to comment.