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
139b19f9
Commit
139b19f9
authored
Dec 10, 2015
by
carl bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(elasticsearch): make series naming generic for pipeline aggs
parent
6e50e241
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
public/app/plugins/datasource/elasticsearch/elastic_response.js
+1
-1
public/app/plugins/datasource/elasticsearch/metric_agg.js
+1
-1
public/app/plugins/datasource/elasticsearch/query_builder.js
+1
-1
public/app/plugins/datasource/elasticsearch/query_def.js
+5
-5
public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts
+2
-2
No files found.
public/app/plugins/datasource/elasticsearch/elastic_response.js
View file @
139b19f9
...
...
@@ -197,7 +197,7 @@ function (_, queryDef) {
});
}
if
(
series
.
field
&&
series
.
metric
===
'moving_avg'
)
{
if
(
series
.
field
&&
queryDef
.
isPipelineAgg
(
series
.
metric
)
)
{
var
appliedAgg
=
_
.
findWhere
(
target
.
metrics
,
{
id
:
series
.
field
});
if
(
appliedAgg
)
{
metricName
+=
' '
+
queryDef
.
describeMetric
(
appliedAgg
);
...
...
public/app/plugins/datasource/elasticsearch/metric_agg.js
View file @
139b19f9
...
...
@@ -37,7 +37,7 @@ function (angular, _, queryDef) {
$scope
.
settingsLinkText
=
''
;
$scope
.
aggDef
=
_
.
findWhere
(
$scope
.
metricAggTypes
,
{
value
:
$scope
.
agg
.
type
});
if
(
queryDef
.
isPipelineAgg
(
$scope
.
agg
))
{
if
(
queryDef
.
isPipelineAgg
(
$scope
.
agg
.
type
))
{
$scope
.
agg
.
pipelineAgg
=
$scope
.
agg
.
pipelineAgg
||
'select metric'
;
$scope
.
agg
.
field
=
$scope
.
agg
.
pipelineAgg
;
$scope
.
settingsLinkText
=
'Options'
;
...
...
public/app/plugins/datasource/elasticsearch/query_builder.js
View file @
139b19f9
...
...
@@ -171,7 +171,7 @@ function (queryDef) {
var
aggField
=
{};
var
metricAgg
=
null
;
if
(
queryDef
.
isPipelineAgg
(
metric
))
{
if
(
queryDef
.
isPipelineAgg
(
metric
.
type
))
{
if
(
metric
.
pipelineAgg
&&
/^
\d
*$/
.
test
(
metric
.
pipelineAgg
))
{
metricAgg
=
{
buckets_path
:
metric
.
pipelineAgg
};
}
else
{
...
...
public/app/plugins/datasource/elasticsearch/query_def.js
View file @
139b19f9
...
...
@@ -76,16 +76,16 @@ function (_) {
},
getPipelineOptions
:
function
(
metric
)
{
if
(
!
this
.
isPipelineAgg
(
metric
))
{
if
(
!
this
.
isPipelineAgg
(
metric
.
type
))
{
return
[];
}
return
this
.
pipelineOptions
[
metric
.
type
];
},
isPipelineAgg
:
function
(
metric
)
{
if
(
metric
.
t
ype
)
{
var
po
=
this
.
pipelineOptions
[
metric
.
t
ype
];
isPipelineAgg
:
function
(
metric
Type
)
{
if
(
metric
T
ype
)
{
var
po
=
this
.
pipelineOptions
[
metric
T
ype
];
return
po
!==
null
&&
po
!==
undefined
;
}
...
...
@@ -96,7 +96,7 @@ function (_) {
var
self
=
this
;
var
result
=
[];
_
.
each
(
targets
.
metrics
,
function
(
metric
)
{
if
(
!
self
.
isPipelineAgg
(
metric
))
{
if
(
!
self
.
isPipelineAgg
(
metric
.
type
))
{
result
.
push
({
text
:
self
.
describeMetric
(
metric
),
value
:
metric
.
id
});
}
});
...
...
public/app/plugins/datasource/elasticsearch/specs/query_def_specs.ts
View file @
139b19f9
...
...
@@ -64,7 +64,7 @@ describe('ElasticQueryDef', function() {
describe
(
'isPipelineMetric'
,
function
()
{
describe
(
'moving_avg'
,
function
()
{
var
result
=
QueryDef
.
isPipelineAgg
(
{
type
:
'moving_avg'
}
);
var
result
=
QueryDef
.
isPipelineAgg
(
'moving_avg'
);
it
(
'is pipe line metric'
,
function
()
{
expect
(
result
).
to
.
be
(
true
);
...
...
@@ -72,7 +72,7 @@ describe('ElasticQueryDef', function() {
});
describe
(
'count'
,
function
()
{
var
result
=
QueryDef
.
isPipelineAgg
(
{
type
:
'count'
}
);
var
result
=
QueryDef
.
isPipelineAgg
(
'count'
);
it
(
'is not pipe line metric'
,
function
()
{
expect
(
result
).
to
.
be
(
false
);
...
...
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