Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
a3500cc3
Unverified
Commit
a3500cc3
authored
7 years ago
by
Daniel Nelson
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix handling of floats with multiple leading zeroes (#4065)
parent
bf0c59f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugins/parsers/influx/machine.go
+8908
-8242
8908 additions, 8242 deletions
plugins/parsers/influx/machine.go
plugins/parsers/influx/machine.go.rl
+1
-1
1 addition, 1 deletion
plugins/parsers/influx/machine.go.rl
plugins/parsers/influx/machine_test.go
+49
-0
49 additions, 0 deletions
plugins/parsers/influx/machine_test.go
with
8958 additions
and
8243 deletions
plugins/parsers/influx/machine.go
+
8908
−
8242
View file @
a3500cc3
This diff is collapsed.
Click to expand it.
plugins/parsers/influx/machine.go.rl
+
1
−
1
View file @
a3500cc3
...
...
@@ -122,7 +122,7 @@ unsigned =
( digit | ( non_zero_digit digit* ) );
number =
( integer
(
'.' digit*
)?
) | (
'.' digit
*
);
'-'? (digit+
('.' digit*)?
|
'.' digit
+
);
scientific =
number 'e'i ["\-+"]? digit+;
...
...
This diff is collapsed.
Click to expand it.
plugins/parsers/influx/machine_test.go
+
49
−
0
View file @
a3500cc3
...
...
@@ -517,6 +517,55 @@ var tests = []struct {
},
},
},
{
name
:
"float without integer digits negative"
,
input
:
[]
byte
(
"cpu value=-.42"
),
results
:
[]
Result
{
Result
{
Name
:
Measurement
,
Value
:
[]
byte
(
"cpu"
),
},
Result
{
Name
:
FieldKey
,
Value
:
[]
byte
(
"value"
),
},
Result
{
Name
:
FieldFloat
,
Value
:
[]
byte
(
"-.42"
),
},
},
},
{
name
:
"float with multiple leading 0"
,
input
:
[]
byte
(
"cpu value=00.42"
),
results
:
[]
Result
{
Result
{
Name
:
Measurement
,
Value
:
[]
byte
(
"cpu"
),
},
Result
{
Name
:
FieldKey
,
Value
:
[]
byte
(
"value"
),
},
Result
{
Name
:
FieldFloat
,
Value
:
[]
byte
(
"00.42"
),
},
},
},
{
name
:
"invalid float with only dot"
,
input
:
[]
byte
(
"cpu value=."
),
results
:
[]
Result
{
Result
{
Name
:
Measurement
,
Value
:
[]
byte
(
"cpu"
),
},
Result
{
err
:
ErrFieldParse
,
},
},
},
{
name
:
"multiple fields"
,
input
:
[]
byte
(
"cpu x=42,y=42"
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment