Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3c1b30e3
Commit
3c1b30e3
authored
Dec 15, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graphite: parser fix for hard case where ip numbers are used as segments, Fixes #1224
parent
5daefc8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletions
+16
-1
src/app/services/graphite/parser.js
+8
-1
src/test/specs/parser-specs.js
+8
-0
No files found.
src/app/services/graphite/parser.js
View file @
3c1b30e3
...
...
@@ -67,9 +67,16 @@ define([
}
if
(
this
.
match
(
'identifier'
)
||
this
.
match
(
'number'
))
{
// hack to handle float numbers in metric segments
var
parts
=
this
.
consumeToken
().
value
.
split
(
'.'
);
if
(
parts
.
length
===
2
)
{
this
.
tokens
.
splice
(
this
.
index
,
0
,
{
type
:
'.'
});
this
.
tokens
.
splice
(
this
.
index
+
1
,
0
,
{
type
:
'number'
,
value
:
parts
[
1
]
});
}
return
{
type
:
'segment'
,
value
:
this
.
consumeToken
().
value
value
:
parts
[
0
]
};
}
...
...
src/test/specs/parser-specs.js
View file @
3c1b30e3
...
...
@@ -165,6 +165,14 @@ define([
expect
(
rootNode
.
params
[
1
].
value
).
to
.
be
(
'#B'
);
});
it
(
'should parse metric expression with ip number segments'
,
function
()
{
var
parser
=
new
Parser
(
'5.10.123.5'
);
var
rootNode
=
parser
.
getAst
();
expect
(
rootNode
.
segments
[
0
].
value
).
to
.
be
(
'5'
);
expect
(
rootNode
.
segments
[
1
].
value
).
to
.
be
(
'10'
);
expect
(
rootNode
.
segments
[
2
].
value
).
to
.
be
(
'123'
);
expect
(
rootNode
.
segments
[
3
].
value
).
to
.
be
(
'5'
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment