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
8ad10149
Commit
8ad10149
authored
Dec 08, 2015
by
Carl Bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds basic support for moving avg in es queries
parent
07310643
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletions
+22
-1
public/app/plugins/datasource/elasticsearch/metric_agg.js
+17
-0
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
+4
-1
public/app/plugins/datasource/elasticsearch/query_def.js
+1
-0
No files found.
public/app/plugins/datasource/elasticsearch/metric_agg.js
View file @
8ad10149
...
...
@@ -78,6 +78,23 @@ function (angular, _, queryDef) {
return
$scope
.
getFields
({
$fieldType
:
'number'
});
};
$scope
.
getMetrics
=
function
()
{
console
.
log
(
$scope
.
target
.
metrics
);
var
mets
=
_
.
filter
(
$scope
.
target
.
metrics
,
function
(
x
)
{
return
x
.
type
!==
'moving_avg'
;
});
mets
=
_
.
map
(
mets
,
function
(
m
)
{
return
{
text
:
m
.
type
,
type
:
m
.
id
};
});
console
.
log
(
mets
);
return
$q
.
when
(
mets
)
.
then
(
uiSegmentSrv
.
transformToSegments
(
false
));
};
$scope
.
addMetricAgg
=
function
()
{
var
addIndex
=
metricAggs
.
length
;
...
...
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
View file @
8ad10149
...
...
@@ -7,7 +7,10 @@
<metric-segment-model
property=
"agg.type"
options=
"metricAggTypes"
on-change=
"onTypeChange()"
custom=
"false"
css-class=
"tight-form-item-large"
></metric-segment-model>
</li>
<li
ng-if=
"aggDef.requiresField"
>
<metric-segment-model
property=
"agg.field"
get-options=
"getFieldsInternal()"
on-change=
"onChange()"
css-class=
"tight-form-item-xxlarge"
></metric-segment>
<metric-segment-model
property=
"agg.field"
get-options=
"getFieldsInternal()"
on-change=
"onChange()"
css-class=
"tight-form-item-xxlarge"
></metric-segment-model>
</li>
<li
ng-if=
"aggDef.requiresBucketsPath"
>
<metric-segment-model
property=
"agg.field"
get-options=
"getMetrics()"
on-change=
"onChange()"
css-class=
"tight-form-item-xxlarge"
></metric-segment-model>
</li>
<li
class=
"tight-form-item last"
ng-if=
"settingsLinkText"
>
<a
ng-click=
"toggleOptions()"
>
{{settingsLinkText}}
</a>
...
...
public/app/plugins/datasource/elasticsearch/query_def.js
View file @
8ad10149
...
...
@@ -13,6 +13,7 @@ function (_) {
{
text
:
"Min"
,
value
:
'min'
,
requiresField
:
true
},
{
text
:
"Extended Stats"
,
value
:
'extended_stats'
,
requiresField
:
true
},
{
text
:
"Percentiles"
,
value
:
'percentiles'
,
requiresField
:
true
},
{
text
:
"Moving Avg"
,
value
:
'moving_avg'
,
requiresField
:
false
,
requiresBucketsPath
:
true
},
{
text
:
"Unique Count"
,
value
:
"cardinality"
,
requiresField
:
true
},
{
text
:
"Raw Document"
,
value
:
"raw_document"
,
requiresField
:
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