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
6a697eed
Commit
6a697eed
authored
Aug 06, 2015
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix deactivating statistics bug
parent
134819cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
public/app/plugins/datasource/cloudwatch/datasource.js
+12
-2
No files found.
public/app/plugins/datasource/cloudwatch/datasource.js
View file @
6a697eed
...
@@ -46,7 +46,7 @@ function (angular, _, kbn) {
...
@@ -46,7 +46,7 @@ function (angular, _, kbn) {
Value
:
target
.
dimensions
[
key
]
Value
:
target
.
dimensions
[
key
]
};
};
});
});
query
.
statistics
=
_
.
key
s
(
target
.
statistics
);
query
.
statistics
=
getActivatedStatistic
s
(
target
.
statistics
);
query
.
period
=
target
.
period
;
query
.
period
=
target
.
period
;
var
range
=
(
end
.
getTime
()
-
start
.
getTime
())
/
1000
;
var
range
=
(
end
.
getTime
()
-
start
.
getTime
())
/
1000
;
...
@@ -130,7 +130,7 @@ function (angular, _, kbn) {
...
@@ -130,7 +130,7 @@ function (angular, _, kbn) {
var
result
=
[];
var
result
=
[];
var
dimensionPart
=
JSON
.
stringify
(
options
.
dimensions
);
var
dimensionPart
=
JSON
.
stringify
(
options
.
dimensions
);
_
.
each
(
_
.
key
s
(
options
.
statistics
),
function
(
s
)
{
_
.
each
(
getActivatedStatistic
s
(
options
.
statistics
),
function
(
s
)
{
var
metricLabel
=
md
.
Label
+
'_'
+
s
+
dimensionPart
;
var
metricLabel
=
md
.
Label
+
'_'
+
s
+
dimensionPart
;
var
dps
=
_
.
map
(
md
.
Datapoints
,
function
(
value
)
{
var
dps
=
_
.
map
(
md
.
Datapoints
,
function
(
value
)
{
...
@@ -144,6 +144,16 @@ function (angular, _, kbn) {
...
@@ -144,6 +144,16 @@ function (angular, _, kbn) {
return
result
;
return
result
;
}
}
function
getActivatedStatistics
(
statistics
)
{
var
activatedStatistics
=
[];
_
.
each
(
statistics
,
function
(
v
,
k
)
{
if
(
v
)
{
activatedStatistics
.
push
(
k
);
}
});
return
activatedStatistics
;
}
function
convertToCloudWatchTime
(
date
)
{
function
convertToCloudWatchTime
(
date
)
{
return
kbn
.
parseDate
(
date
);
return
kbn
.
parseDate
(
date
);
}
}
...
...
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