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
ced5f479
Commit
ced5f479
authored
Feb 27, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented segmented loading in histogram panel
parent
4d375bd0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
panels/histogram/module.js
+19
-5
panels/timepicker/module.js
+2
-2
No files found.
panels/histogram/module.js
View file @
ced5f479
...
...
@@ -45,13 +45,15 @@ angular.module('kibana.histogram', [])
$scope
.
get_data
();
}
$scope
.
get_data
=
function
()
{
$scope
.
get_data
=
function
(
segment
)
{
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
_segment
=
_
.
isUndefined
(
segment
)
?
0
:
segment
$scope
.
panel
.
loading
=
true
;
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
);
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
panel
.
index
[
_segment
]
);
// Build the question part of the query
var
queries
=
[];
...
...
@@ -81,25 +83,37 @@ angular.module('kibana.histogram', [])
results
.
then
(
function
(
results
)
{
$scope
.
panel
.
loading
=
false
;
$scope
.
hits
=
results
.
hits
.
total
;
if
(
_segment
==
0
)
$scope
.
data
=
[];
_
.
each
(
results
.
facets
,
function
(
v
,
k
)
{
// Null values at each end of the time range ensure we see entire range
if
(
_
.
isUndefined
(
$scope
.
data
[
k
])
||
_segment
==
0
)
{
var
data
=
[[
$scope
.
time
.
from
.
getTime
(),
null
]];
}
else
{
var
data
=
$scope
.
data
[
k
].
data
}
_
.
each
(
v
.
entries
,
function
(
v
,
k
)
{
data
.
push
([
v
[
'time'
],
v
[
'count'
]])
});
data
.
push
([
$scope
.
time
.
to
.
getTime
(),
null
])
var
series
=
{
data
:
{
var
series
=
{
data
:
{
label
:
$scope
.
panel
.
query
[
k
].
label
||
k
,
data
:
data
,
}};
}
};
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
query
[
k
].
color
)))
series
.
data
.
color
=
$scope
.
panel
.
query
[
k
].
color
;
$scope
.
data
.
push
(
series
.
data
)
$scope
.
data
[
k
]
=
series
.
data
});
$scope
.
$emit
(
'render'
)
if
(
_segment
<
$scope
.
panel
.
index
.
length
-
1
)
$scope
.
get_data
(
_segment
+
1
)
});
}
...
...
panels/timepicker/module.js
View file @
ced5f479
...
...
@@ -182,7 +182,7 @@ angular.module('kibana.timepicker', [])
// in a single object. Not sure if I like this.
if
(
$scope
.
panel
.
timed_indices
)
{
indices
(
$scope
.
time
.
from
,
$scope
.
time
.
to
).
then
(
function
(
p
)
{
$scope
.
time
.
index
=
p
.
join
()
;
$scope
.
time
.
index
=
p
;
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'time'
,
$scope
.
time
)
});
}
else
{
...
...
@@ -207,7 +207,7 @@ angular.module('kibana.timepicker', [])
});
return
all_indices
().
then
(
function
(
p
)
{
var
indices
=
_
.
intersection
(
p
,
possible
);
var
indices
=
_
.
intersection
(
p
ossible
,
p
);
indices
.
reverse
();
return
indices
.
length
==
0
?
[
$scope
.
panel
.
defaultindex
]
:
indices
;
})
...
...
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