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
a66825c7
Commit
a66825c7
authored
Nov 10, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
parents
99ee38ce
5d8a51c3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
6 deletions
+44
-6
pkg/api/cloudwatch/metrics.go
+2
-0
pkg/social/social.go
+3
-3
public/app/core/utils/kbn.js
+26
-1
public/app/plugins/datasource/cloudwatch/datasource.js
+1
-1
public/app/plugins/datasource/cloudwatch/partials/config.html
+6
-1
public/test/core/utils/kbn_specs.js
+6
-0
No files found.
pkg/api/cloudwatch/metrics.go
View file @
a66825c7
...
...
@@ -65,6 +65,8 @@ func init() {
}
}
// Whenever this list is updated, frontend list should also be updated.
// Please update the region list in public/app/plugins/datasource/cloudwatch/partials/config.html
func
handleGetRegions
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
regions
:=
[]
string
{
"us-east-1"
,
"us-west-2"
,
"us-west-1"
,
"eu-west-1"
,
"eu-central-1"
,
"ap-southeast-1"
,
...
...
pkg/social/social.go
View file @
a66825c7
...
...
@@ -193,7 +193,7 @@ func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error) {
Verified
bool
`json:"verified"`
}
emailsUrl
:=
fmt
.
Sprintf
(
"https://api.github.com/user
/emails"
)
emailsUrl
:=
fmt
.
Sprintf
(
s
.
apiUrl
+
"
/emails"
)
r
,
err
:=
client
.
Get
(
emailsUrl
)
if
err
!=
nil
{
return
""
,
err
...
...
@@ -222,7 +222,7 @@ func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error)
Id
int
`json:"id"`
}
membershipUrl
:=
fmt
.
Sprintf
(
"https://api.github.com/user
/teams"
)
membershipUrl
:=
fmt
.
Sprintf
(
s
.
apiUrl
+
"
/teams"
)
r
,
err
:=
client
.
Get
(
membershipUrl
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -249,7 +249,7 @@ func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error)
Login
string
`json:"login"`
}
url
:=
fmt
.
Sprintf
(
"https://api.github.com/user
/orgs"
)
url
:=
fmt
.
Sprintf
(
s
.
apiUrl
+
"
/orgs"
)
r
,
err
:=
client
.
Get
(
url
)
if
err
!=
nil
{
return
nil
,
err
...
...
public/app/core/utils/kbn.js
View file @
a66825c7
...
...
@@ -310,6 +310,16 @@ function($, _) {
};
};
kbn
.
formatBuilders
.
simpleCountUnit
=
function
(
symbol
)
{
var
units
=
[
''
,
'K'
,
'M'
,
'B'
,
'T'
];
var
scaler
=
kbn
.
formatBuilders
.
scaledUnits
(
1000
,
units
);
return
function
(
size
,
decimals
,
scaledDecimals
)
{
if
(
size
===
null
)
{
return
""
;
}
var
scaled
=
scaler
(
size
,
decimals
,
scaledDecimals
);
return
scaled
+
" "
+
symbol
;
};
};
///// VALUE FORMATS /////
// Dimensionless Units
...
...
@@ -344,6 +354,12 @@ function($, _) {
kbn
.
valueFormats
.
bps
=
kbn
.
formatBuilders
.
decimalSIPrefix
(
'bps'
);
kbn
.
valueFormats
.
Bps
=
kbn
.
formatBuilders
.
decimalSIPrefix
(
'Bps'
);
// Throughput
kbn
.
valueFormats
.
ops
=
kbn
.
formatBuilders
.
simpleCountUnit
(
'ops'
);
kbn
.
valueFormats
.
rps
=
kbn
.
formatBuilders
.
simpleCountUnit
(
'rps'
);
kbn
.
valueFormats
.
wps
=
kbn
.
formatBuilders
.
simpleCountUnit
(
'wps'
);
kbn
.
valueFormats
.
iops
=
kbn
.
formatBuilders
.
simpleCountUnit
(
'iops'
);
// Energy
kbn
.
valueFormats
.
watt
=
kbn
.
formatBuilders
.
decimalSIPrefix
(
'W'
);
kbn
.
valueFormats
.
kwatt
=
kbn
.
formatBuilders
.
decimalSIPrefix
(
'W'
,
1
);
...
...
@@ -523,6 +539,15 @@ function($, _) {
]
},
{
text
:
'throughput'
,
submenu
:
[
{
text
:
'ops/sec (ops)'
,
value
:
'ops'
},
{
text
:
'reads/sec (rps)'
,
value
:
'rps'
},
{
text
:
'writes/sec (wps)'
,
value
:
'wps'
},
{
text
:
'I/O ops/sec (iops)'
,
value
:
'iops'
},
]
},
{
text
:
'length'
,
submenu
:
[
{
text
:
'millimetre (mm)'
,
value
:
'lengthmm'
},
...
...
@@ -576,7 +601,7 @@ function($, _) {
{
text
:
'Inches of mercury'
,
value
:
'pressurehg'
},
{
text
:
'PSI'
,
value
:
'pressurepsi'
},
]
}
,
}
];
};
...
...
public/app/plugins/datasource/cloudwatch/datasource.js
View file @
a66825c7
...
...
@@ -216,7 +216,7 @@ function (angular, _) {
CloudWatchDatasource
.
prototype
.
testDatasource
=
function
()
{
/* use billing metrics for test */
var
region
=
'us-east-1'
;
var
region
=
this
.
defaultRegion
;
var
namespace
=
'AWS/Billing'
;
var
metricName
=
'EstimatedCharges'
;
var
dimensions
=
{};
...
...
public/app/plugins/datasource/cloudwatch/partials/config.html
View file @
a66825c7
...
...
@@ -19,8 +19,13 @@
<li
class=
"tight-form-item"
style=
"width: 200px"
>
Default Region
<tip>
Specify the region, such as for US West (Oregon) use ` us-west-2 ` as the region.
</tip>
</li>
<!--
Whenever this list is updated, backend list should also be updated.
Please update the region list in pkg/api/cloudwatch/metric.go
-->
<li>
<input
type=
"text"
class=
"tight-form-input input-large last"
ng-model=
'current.jsonData.defaultRegion'
placeholder=
""
></input>
<select
class=
"tight-form-input input-large last"
ng-model=
"current.jsonData.defaultRegion"
ng-options=
"region for region in ['us-east-1', 'us-west-2', 'us-west-1', 'eu-west-1',
'eu-central-1', 'ap-southeast-1' ,'ap-southeast-2' ,'ap-northeast-1' ,'sa-east-1' ,'cn-north-1']"
></select>
</li>
</ul>
<div
class=
"clearfix"
></div>
...
...
public/test/core/utils/kbn_specs.js
View file @
a66825c7
...
...
@@ -62,6 +62,12 @@ define([
describeValueFormat
(
'ns'
,
25
,
1
,
0
,
'25 ns'
);
describeValueFormat
(
'ns'
,
2558
,
50
,
0
,
'2.56 µs'
);
describeValueFormat
(
'ops'
,
123
,
1
,
0
,
'123 ops'
);
describeValueFormat
(
'rps'
,
456000
,
1000
,
-
1
,
'456K rps'
);
describeValueFormat
(
'rps'
,
123456789
,
1000000
,
2
,
'123.457M rps'
);
describeValueFormat
(
'wps'
,
789000000
,
1000000
,
-
1
,
'789M wps'
);
describeValueFormat
(
'iops'
,
11000000000
,
1000000000
,
-
1
,
'11B iops'
);
describe
(
'kbn.toFixed and negative decimals'
,
function
()
{
it
(
'should treat as zero decimals'
,
function
()
{
var
str
=
kbn
.
toFixed
(
186.123
,
-
2
);
...
...
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