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
3842bcb9
Commit
3842bcb9
authored
Sep 01, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(influxdb): quote field name, fixes #2629
parent
f9b98767
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
public/app/plugins/datasource/influxdb/queryBuilder.js
+1
-1
public/test/specs/influx09-querybuilder-specs.js
+7
-7
No files found.
public/app/plugins/datasource/influxdb/queryBuilder.js
View file @
3842bcb9
...
...
@@ -102,7 +102,7 @@ function (_) {
if
(
i
>
0
)
{
query
+=
', '
;
}
query
+=
field
.
func
+
'(
'
+
field
.
name
+
'
)'
;
query
+=
field
.
func
+
'(
"'
+
field
.
name
+
'"
)'
;
}
var
measurement
=
target
.
measurement
;
...
...
public/test/specs/influx09-querybuilder-specs.js
View file @
3842bcb9
...
...
@@ -13,7 +13,7 @@ define([
var
query
=
builder
.
build
();
it
(
'should generate correct query'
,
function
()
{
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE $timeFilter GROUP BY time($interval)'
);
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE $timeFilter GROUP BY time($interval)'
);
});
});
...
...
@@ -27,14 +27,14 @@ define([
var
query
=
builder
.
build
();
it
(
'should generate correct query'
,
function
()
{
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
AND $timeFilter'
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
AND $timeFilter'
+
' GROUP BY time($interval)'
);
});
it
(
'should switch regex operator with tag value is regex'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
measurement
:
'cpu'
,
tags
:
[{
key
:
'app'
,
value
:
'/e.*/'
}]});
var
query
=
builder
.
build
();
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE "app" =~ /e.*/ AND $timeFilter GROUP BY time($interval)'
);
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE "app" =~ /e.*/ AND $timeFilter GROUP BY time($interval)'
);
});
});
...
...
@@ -48,7 +48,7 @@ define([
var
query
=
builder
.
build
();
it
(
'should generate correct query'
,
function
()
{
expect
(
query
).
to
.
be
(
'SELECT sum(
tx_in), mean(tx_out
) FROM "cpu" WHERE $timeFilter GROUP BY time($interval)'
);
expect
(
query
).
to
.
be
(
'SELECT sum(
"tx_in"), mean("tx_out"
) FROM "cpu" WHERE $timeFilter GROUP BY time($interval)'
);
});
});
...
...
@@ -61,7 +61,7 @@ define([
var
query
=
builder
.
build
();
it
(
'should generate correct query'
,
function
()
{
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
AND "app" =
\'
email
\'
AND '
+
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
AND "app" =
\'
email
\'
AND '
+
'$timeFilter GROUP BY time($interval)'
);
});
});
...
...
@@ -75,7 +75,7 @@ define([
var
query
=
builder
.
build
();
it
(
'should generate correct query'
,
function
()
{
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
OR "hostname" =
\'
server2
\'
AND '
+
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE "hostname" =
\'
server1
\'
OR "hostname" =
\'
server2
\'
AND '
+
'$timeFilter GROUP BY time($interval)'
);
});
});
...
...
@@ -89,7 +89,7 @@ define([
});
var
query
=
builder
.
build
();
expect
(
query
).
to
.
be
(
'SELECT mean(
value
) FROM "cpu" WHERE $timeFilter '
+
expect
(
query
).
to
.
be
(
'SELECT mean(
"value"
) FROM "cpu" WHERE $timeFilter '
+
'GROUP BY time($interval), "host"'
);
});
});
...
...
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