Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola committed Sep 29, 2023
1 parent e0f2981 commit 53ec153
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
"crates/orchestrator",
"crates/provider",
"crates/test-runner",
"crates/prom-parser",
"crates/prom-metrics-parser",
]

[workspace.dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "prom-parser"
name = "prom-metrics-parser"
version = "0.1.0"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Grammar taken from https://github.com/mitghi/promerge/ with
// some small modifications.
alpha = _{'a'..'z' | 'A'..'Z'}
alphanum = _{'a'..'z' | 'A'..'Z' | '0'..'9'}
number = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn parse<'a>(input: &'a str) -> Result<MetricMap, ParserError> {
Rule::typexpr |
Rule::helpexpr
=> {
// don't need to parse comments for now.
// don't need to collect comments/types/helpers blocks.
continue;

},
Expand All @@ -57,7 +57,7 @@ pub fn parse<'a>(input: &'a str) -> Result<MetricMap, ParserError> {
key = v.as_span().as_str();
}
Rule::NaN | Rule::posInf | Rule::negInf => {
// noop
// noop (not used in substrate metrics)
}
Rule::number => {
val = v.as_span().as_str().parse::<f64>()?;
Expand Down Expand Up @@ -138,7 +138,7 @@ mod tests {

#[test]
fn parse_metrics_works() {
let metrics_raw = fs::read_to_string("./testing/m.txt").unwrap();
let metrics_raw = fs::read_to_string("./testing/metrics.txt").unwrap();
let metrics = parse(&metrics_raw).unwrap();

// full key
Expand Down
File renamed without changes.

0 comments on commit 53ec153

Please sign in to comment.