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
acb45867
Unverified
Commit
acb45867
authored
Dec 03, 2018
by
Marcus Efraimsson
Committed by
GitHub
Dec 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14179 from mattiarossi/master
Add support for offset in date histogram aggregation
parents
d16b3488
ce74b1dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
pkg/tsdb/elasticsearch/client/models.go
+1
-0
pkg/tsdb/elasticsearch/time_series_query.go
+4
-0
public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html
+10
-0
public/app/plugins/datasource/elasticsearch/query_builder.ts
+4
-0
No files found.
pkg/tsdb/elasticsearch/client/models.go
View file @
acb45867
...
@@ -240,6 +240,7 @@ type DateHistogramAgg struct {
...
@@ -240,6 +240,7 @@ type DateHistogramAgg struct {
Missing
*
string
`json:"missing,omitempty"`
Missing
*
string
`json:"missing,omitempty"`
ExtendedBounds
*
ExtendedBounds
`json:"extended_bounds"`
ExtendedBounds
*
ExtendedBounds
`json:"extended_bounds"`
Format
string
`json:"format"`
Format
string
`json:"format"`
Offset
string
`json:"offset,omitempty"`
}
}
// FiltersAggregation represents a filters aggregation
// FiltersAggregation represents a filters aggregation
...
...
pkg/tsdb/elasticsearch/time_series_query.go
View file @
acb45867
...
@@ -134,6 +134,10 @@ func addDateHistogramAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg, timeFro
...
@@ -134,6 +134,10 @@ func addDateHistogramAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg, timeFro
a
.
Interval
=
"$__interval"
a
.
Interval
=
"$__interval"
}
}
if
offset
,
err
:=
bucketAgg
.
Settings
.
Get
(
"offset"
)
.
String
();
err
==
nil
{
a
.
Offset
=
offset
}
if
missing
,
err
:=
bucketAgg
.
Settings
.
Get
(
"missing"
)
.
String
();
err
==
nil
{
if
missing
,
err
:=
bucketAgg
.
Settings
.
Get
(
"missing"
)
.
String
();
err
==
nil
{
a
.
Missing
=
&
missing
a
.
Missing
=
&
missing
}
}
...
...
public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html
View file @
acb45867
...
@@ -70,6 +70,16 @@
...
@@ -70,6 +70,16 @@
</label>
</label>
<input
class=
"gf-form-input max-width-12"
type=
"number"
ng-model=
"agg.settings.trimEdges"
ng-change=
"onChangeInternal()"
>
<input
class=
"gf-form-input max-width-12"
type=
"number"
ng-model=
"agg.settings.trimEdges"
ng-change=
"onChangeInternal()"
>
</div>
</div>
<div
class=
"gf-form offset-width-7"
>
<label
class=
"gf-form-label width-10"
>
Offset
<info-popover
mode=
"right-normal"
>
Change the start value of each bucket by the specified positive (+) or negative offset (-) duration, such as 1h for an hour, or 1d for a day
</info-popover>
</label>
<input
class=
"gf-form-input max-width-12"
type=
"text"
ng-model=
"agg.settings.offset"
ng-change=
"onChangeInternal()"
>
</div>
</div>
</div>
<div
ng-if=
"agg.type === 'histogram'"
>
<div
ng-if=
"agg.type === 'histogram'"
>
...
...
public/app/plugins/datasource/elasticsearch/query_builder.ts
View file @
acb45867
...
@@ -72,6 +72,10 @@ export class ElasticQueryBuilder {
...
@@ -72,6 +72,10 @@ export class ElasticQueryBuilder {
esAgg
.
extended_bounds
=
{
min
:
'$timeFrom'
,
max
:
'$timeTo'
};
esAgg
.
extended_bounds
=
{
min
:
'$timeFrom'
,
max
:
'$timeTo'
};
esAgg
.
format
=
'epoch_millis'
;
esAgg
.
format
=
'epoch_millis'
;
if
(
settings
.
offset
!==
''
)
{
esAgg
.
offset
=
settings
.
offset
;
}
if
(
esAgg
.
interval
===
'auto'
)
{
if
(
esAgg
.
interval
===
'auto'
)
{
esAgg
.
interval
=
'$__interval'
;
esAgg
.
interval
=
'$__interval'
;
}
}
...
...
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