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
99c5cb5e
Commit
99c5cb5e
authored
Aug 23, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'spencer/zero-filled-ts' into spencer-zero
parents
56351038
a01dd003
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
22 deletions
+42
-22
panels/histogram/module.js
+42
-22
No files found.
panels/histogram/module.js
View file @
99c5cb5e
...
@@ -95,7 +95,7 @@ angular.module('kibana.histogram', [])
...
@@ -95,7 +95,7 @@ angular.module('kibana.histogram', [])
};
};
$scope
.
get_interval
=
function
()
{
$scope
.
get_interval
=
function
()
{
var
interval
=
$scope
.
panel
.
interval
,
var
interval
=
$scope
.
panel
.
interval
,
range
;
range
;
if
(
$scope
.
panel
.
auto_int
)
{
if
(
$scope
.
panel
.
auto_int
)
{
range
=
$scope
.
get_time_range
();
range
=
$scope
.
get_time_range
();
...
@@ -188,8 +188,8 @@ angular.module('kibana.histogram', [])
...
@@ -188,8 +188,8 @@ angular.module('kibana.histogram', [])
// Make sure we're still on the same query/queries
// Make sure we're still on the same query/queries
if
(
$scope
.
query_id
===
query_id
&&
_
.
difference
(
facetIds
,
$scope
.
panel
.
queries
.
ids
).
length
===
0
)
{
if
(
$scope
.
query_id
===
query_id
&&
_
.
difference
(
facetIds
,
$scope
.
panel
.
queries
.
ids
).
length
===
0
)
{
var
i
=
0
,
var
i
=
0
,
time_series
,
time_series
,
hits
;
hits
;
_
.
each
(
$scope
.
panel
.
queries
.
ids
,
function
(
id
)
{
_
.
each
(
$scope
.
panel
.
queries
.
ids
,
function
(
id
)
{
...
@@ -342,8 +342,19 @@ angular.module('kibana.histogram', [])
...
@@ -342,8 +342,19 @@ angular.module('kibana.histogram', [])
lineWidth
:
scope
.
panel
.
linewidth
,
lineWidth
:
scope
.
panel
.
linewidth
,
steps
:
false
steps
:
false
},
},
bars
:
{
show
:
scope
.
panel
.
bars
,
fill
:
1
,
lineWidth
:
0
,
barWidth
:
barwidth
/
1.7
,
zero
:
false
},
bars
:
{
points
:
{
show
:
scope
.
panel
.
points
,
fill
:
1
,
fillColor
:
false
,
radius
:
5
},
show
:
scope
.
panel
.
bars
,
fill
:
1
,
barWidth
:
barwidth
/
1.8
,
zero
:
false
,
lineWidth
:
0
},
points
:
{
show
:
scope
.
panel
.
points
,
fill
:
1
,
fillColor
:
false
,
radius
:
5
},
shadowSize
:
1
shadowSize
:
1
},
},
yaxis
:
{
yaxis
:
{
...
@@ -485,24 +496,33 @@ angular.module('kibana.histogram', [])
...
@@ -485,24 +496,33 @@ angular.module('kibana.histogram', [])
*/
*/
this
.
ZeroFilled
.
prototype
.
getFlotPairs
=
function
()
{
this
.
ZeroFilled
.
prototype
.
getFlotPairs
=
function
()
{
// var startTime = performance.now();
// var startTime = performance.now();
var
times
=
_
.
map
(
_
.
keys
(
this
.
_data
),
base10Int
).
sort
(),
var
times
=
_
.
map
(
_
.
keys
(
this
.
_data
),
base10Int
).
sort
(),
result
=
[],
result
=
[];
i
,
_
.
each
(
times
,
function
(
time
,
i
,
times
)
{
next
,
var
next
,
expected_next
,
prev
,
expected_prev
;
expected_next
;
for
(
i
=
0
;
i
<
times
.
length
;
i
++
)
{
// check for previous measurement
result
.
push
([
times
[
i
],
this
.
_data
[
times
[
i
]]
]);
if
(
i
>
0
)
{
next
=
times
[
i
+
1
];
prev
=
times
[
i
-
1
];
expected_next
=
times
[
i
]
+
this
.
interval_ms
;
expected_prev
=
time
-
this
.
interval_ms
;
for
(;
times
.
length
>
i
&&
next
>
expected_next
;
expected_next
+=
this
.
interval_ms
)
{
if
(
prev
<
expected_prev
)
{
/**
result
.
push
([
expected_prev
,
0
]);
* since we don't know how the server will round subsequent segments
}
* we have to recheck for blanks each time.
*/
// this._data[expected_next] = 0;
result
.
push
([
expected_next
,
0
]);
}
}
}
// add the current time
result
.
push
([
time
,
this
.
_data
[
time
]
]);
// check for next measurement
if
(
times
.
length
>
i
)
{
next
=
times
[
i
+
1
];
expected_next
=
time
+
this
.
interval_ms
;
if
(
next
>
expected_next
)
{
result
.
push
([
expected_next
,
0
]);
}
}
},
this
);
// console.log(Math.round((performance.now() - startTime)*100)/100, 'ms to get', result.length, 'pairs');
// console.log(Math.round((performance.now() - startTime)*100)/100, 'ms to get', result.length, 'pairs');
return
result
;
return
result
;
};
};
...
...
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