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
08e816a5
Commit
08e816a5
authored
Oct 23, 2014
by
Mark Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for regex based series merging in InfluxDB
parent
79c5d48a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletions
+30
-1
src/app/services/influxdb/influxQueryBuilder.js
+1
-1
src/test/specs/influxQueryBuilder-specs.js
+29
-0
No files found.
src/app/services/influxdb/influxQueryBuilder.js
View file @
08e816a5
...
...
@@ -18,7 +18,7 @@ function () {
var
query
=
'select '
;
var
seriesName
=
target
.
series
;
if
(
!
seriesName
.
match
(
'^/.*/'
))
{
if
(
!
seriesName
.
match
(
'^/.*/'
)
&&
!
seriesName
.
match
(
/^merge
\(
.*
\)
/
)
)
{
seriesName
=
'"'
+
seriesName
+
'"'
;
}
...
...
src/test/specs/influxQueryBuilder-specs.js
View file @
08e816a5
...
...
@@ -44,6 +44,35 @@ define([
});
describe
(
'merge function detection'
,
function
()
{
it
(
'should not quote wrap regex merged series'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
series
:
'merge(/^google.test/)'
,
column
:
'value'
,
function
:
'mean'
});
var
query
=
builder
.
build
();
expect
(
query
).
to
.
be
(
'select mean(value) from merge(/^google.test/) where $timeFilter '
+
'group by time($interval) order asc'
);
});
it
(
'should quote wrap series names that start with "merge"'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
series
:
'merge.google.test'
,
column
:
'value'
,
function
:
'mean'
});
var
query
=
builder
.
build
();
expect
(
query
).
to
.
be
(
'select mean(value) from "merge.google.test" where $timeFilter '
+
'group by time($interval) order asc'
);
});
});
});
});
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