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
b2eabda5
Commit
b2eabda5
authored
Jul 31, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:kamaradclimber/grafana into kamaradclimber-master
parents
305e12be
f5f32568
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
src/app/components/kbn.js
+21
-6
No files found.
src/app/components/kbn.js
View file @
b2eabda5
...
...
@@ -532,8 +532,12 @@ function($, _, moment) {
};
kbn
.
msFormat
=
function
(
size
,
decimals
)
{
if
(
Math
.
abs
(
size
)
<
1000
)
{
return
size
.
toFixed
(
0
)
+
" ms"
;
// Less than 1 milli, downscale to micro
if
(
Math
.
abs
(
size
)
<
1
)
{
return
kbn
.
microsFormat
(
size
*
1000
,
decimals
);
}
else
if
(
Math
.
abs
(
size
)
<
1000
)
{
return
size
.
toFixed
(
decimals
)
+
" ms"
;
}
// Less than 1 min
else
if
(
Math
.
abs
(
size
)
<
60000
)
{
...
...
@@ -556,8 +560,12 @@ function($, _, moment) {
};
kbn
.
sFormat
=
function
(
size
,
decimals
)
{
// Less than 1 sec, downscale to milli
if
(
Math
.
abs
(
size
)
<
1
)
{
return
kbn
.
msFormat
(
size
*
1000
,
decimals
);
}
// Less than 10 min, use seconds
if
(
Math
.
abs
(
size
)
<
600
)
{
else
if
(
Math
.
abs
(
size
)
<
600
)
{
return
size
.
toFixed
(
decimals
)
+
" s"
;
}
// Less than 1 hour, devide in minutes
...
...
@@ -581,8 +589,12 @@ function($, _, moment) {
};
kbn
.
microsFormat
=
function
(
size
,
decimals
)
{
if
(
Math
.
abs
(
size
)
<
1000
)
{
return
size
.
toFixed
(
0
)
+
" µs"
;
// Less than 1 micro, downscale to nano
if
(
Math
.
abs
(
size
)
<
1
)
{
return
kbn
.
nanosFormat
(
size
*
1000
,
decimals
);
}
else
if
(
Math
.
abs
(
size
)
<
1000
)
{
return
size
.
toFixed
(
decimals
)
+
" µs"
;
}
else
if
(
Math
.
abs
(
size
)
<
1000000
)
{
return
(
size
/
1000
).
toFixed
(
decimals
)
+
" ms"
;
...
...
@@ -593,7 +605,10 @@ function($, _, moment) {
};
kbn
.
nanosFormat
=
function
(
size
,
decimals
)
{
if
(
Math
.
abs
(
size
)
<
1000
)
{
if
(
Math
.
abs
(
size
)
<
1
)
{
return
size
.
toFixed
(
decimals
)
+
" ns"
;
}
else
if
(
Math
.
abs
(
size
)
<
1000
)
{
return
size
.
toFixed
(
0
)
+
" ns"
;
}
else
if
(
Math
.
abs
(
size
)
<
1000000
)
{
...
...
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