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
e22e20fa
Commit
e22e20fa
authored
Nov 13, 2015
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cloudwatch annotation, reflect API change
parent
79c85569
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
public/app/plugins/datasource/cloudwatch/datasource.js
+4
-3
public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts
+8
-2
No files found.
public/app/plugins/datasource/cloudwatch/datasource.js
View file @
e22e20fa
...
@@ -226,7 +226,8 @@ function (angular, _, moment, dateMath) {
...
@@ -226,7 +226,8 @@ function (angular, _, moment, dateMath) {
});
});
};
};
CloudWatchDatasource
.
prototype
.
annotationQuery
=
function
(
annotation
,
range
)
{
CloudWatchDatasource
.
prototype
.
annotationQuery
=
function
(
options
)
{
var
annotation
=
options
.
annotation
;
var
region
=
templateSrv
.
replace
(
annotation
.
region
);
var
region
=
templateSrv
.
replace
(
annotation
.
region
);
var
namespace
=
templateSrv
.
replace
(
annotation
.
namespace
);
var
namespace
=
templateSrv
.
replace
(
annotation
.
namespace
);
var
metricName
=
templateSrv
.
replace
(
annotation
.
metricName
);
var
metricName
=
templateSrv
.
replace
(
annotation
.
metricName
);
...
@@ -254,8 +255,8 @@ function (angular, _, moment, dateMath) {
...
@@ -254,8 +255,8 @@ function (angular, _, moment, dateMath) {
this
.
performDescribeAlarmsForMetric
(
region
,
namespace
,
metricName
,
dimensions
,
statistic
,
period
).
then
(
function
(
alarms
)
{
this
.
performDescribeAlarmsForMetric
(
region
,
namespace
,
metricName
,
dimensions
,
statistic
,
period
).
then
(
function
(
alarms
)
{
var
eventList
=
[];
var
eventList
=
[];
var
start
=
convertToCloudWatchTime
(
range
.
from
,
false
);
var
start
=
convertToCloudWatchTime
(
options
.
range
.
from
,
false
);
var
end
=
convertToCloudWatchTime
(
range
.
to
,
true
);
var
end
=
convertToCloudWatchTime
(
options
.
range
.
to
,
true
);
_
.
each
(
alarms
.
MetricAlarms
,
function
(
alarm
)
{
_
.
each
(
alarms
.
MetricAlarms
,
function
(
alarm
)
{
self
.
performDescribeAlarmHistory
(
region
,
alarm
.
AlarmName
,
start
,
end
).
then
(
function
(
history
)
{
self
.
performDescribeAlarmHistory
(
region
,
alarm
.
AlarmName
,
start
,
end
).
then
(
function
(
history
)
{
_
.
each
(
history
.
AlarmHistoryItems
,
function
(
h
)
{
_
.
each
(
history
.
AlarmHistoryItems
,
function
(
h
)
{
...
...
public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts
View file @
e22e20fa
...
@@ -191,11 +191,17 @@ describe('CloudWatchDatasource', function() {
...
@@ -191,11 +191,17 @@ describe('CloudWatchDatasource', function() {
});
});
describe
(
'When performing annotationQuery'
,
function
()
{
describe
(
'When performing annotationQuery'
,
function
()
{
var
annotation
=
{
var
parameter
=
{
annotation
:
{
region
:
'us-east-1'
,
region
:
'us-east-1'
,
namespace
:
'AWS/EC2'
,
namespace
:
'AWS/EC2'
,
metricName
:
'CPUUtilization'
,
metricName
:
'CPUUtilization'
,
dimensions
:
'InstanceId=i-12345678'
dimensions
:
'InstanceId=i-12345678'
},
range
:
{
from
:
moment
(
1443438674760
),
to
:
moment
(
1443460274760
)
}
};
};
var
alarmResponse
=
{
var
alarmResponse
=
{
MetricAlarms
:
[
MetricAlarms
:
[
...
@@ -228,7 +234,7 @@ describe('CloudWatchDatasource', function() {
...
@@ -228,7 +234,7 @@ describe('CloudWatchDatasource', function() {
};
};
});
});
it
(
'should return annotation list'
,
function
(
done
)
{
it
(
'should return annotation list'
,
function
(
done
)
{
ctx
.
ds
.
annotationQuery
(
annotation
,
{
from
:
moment
(
1443438674760
),
to
:
moment
(
1443460274760
)}
).
then
(
function
(
result
)
{
ctx
.
ds
.
annotationQuery
(
parameter
).
then
(
function
(
result
)
{
expect
(
result
[
0
].
title
).
to
.
be
(
'test_alarm_name'
);
expect
(
result
[
0
].
title
).
to
.
be
(
'test_alarm_name'
);
expect
(
result
[
0
].
text
).
to
.
be
(
'test_history_summary'
);
expect
(
result
[
0
].
text
).
to
.
be
(
'test_history_summary'
);
done
();
done
();
...
...
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