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
d7d20a5b
Commit
d7d20a5b
authored
Apr 12, 2019
by
Mitsuhiro Tanda
Committed by
Torkel Ödegaard
Apr 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CloudWatch: fix color order (#16408)
* fix cloudwatch color order * fix test * use for-of
parent
3c21a121
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
public/app/plugins/datasource/cloudwatch/datasource.ts
+5
-4
public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts
+5
-0
No files found.
public/app/plugins/datasource/cloudwatch/datasource.ts
View file @
d7d20a5b
...
@@ -138,15 +138,16 @@ export default class CloudWatchDatasource {
...
@@ -138,15 +138,16 @@ export default class CloudWatchDatasource {
const
data
=
[];
const
data
=
[];
if
(
res
.
results
)
{
if
(
res
.
results
)
{
_
.
forEach
(
res
.
results
,
queryRes
=>
{
for
(
const
query
of
request
.
queries
)
{
_
.
forEach
(
queryRes
.
series
,
series
=>
{
const
queryRes
=
res
.
results
[
query
.
refId
];
for
(
const
series
of
queryRes
.
series
)
{
const
s
=
{
target
:
series
.
name
,
datapoints
:
series
.
points
}
as
any
;
const
s
=
{
target
:
series
.
name
,
datapoints
:
series
.
points
}
as
any
;
if
(
queryRes
.
meta
.
unit
)
{
if
(
queryRes
.
meta
.
unit
)
{
s
.
unit
=
queryRes
.
meta
.
unit
;
s
.
unit
=
queryRes
.
meta
.
unit
;
}
}
data
.
push
(
s
);
data
.
push
(
s
);
}
);
}
}
);
}
}
}
return
{
data
:
data
};
return
{
data
:
data
};
...
...
public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts
View file @
d7d20a5b
...
@@ -42,6 +42,7 @@ describe('CloudWatchDatasource', () => {
...
@@ -42,6 +42,7 @@ describe('CloudWatchDatasource', () => {
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
targets
:
[
targets
:
[
{
{
refId
:
'A'
,
region
:
'us-east-1'
,
region
:
'us-east-1'
,
namespace
:
'AWS/EC2'
,
namespace
:
'AWS/EC2'
,
metricName
:
'CPUUtilization'
,
metricName
:
'CPUUtilization'
,
...
@@ -103,6 +104,7 @@ describe('CloudWatchDatasource', () => {
...
@@ -103,6 +104,7 @@ describe('CloudWatchDatasource', () => {
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
targets
:
[
targets
:
[
{
{
refId
:
'A'
,
region
:
'us-east-1'
,
region
:
'us-east-1'
,
namespace
:
'AWS/EC2'
,
namespace
:
'AWS/EC2'
,
metricName
:
'CPUUtilization'
,
metricName
:
'CPUUtilization'
,
...
@@ -128,6 +130,7 @@ describe('CloudWatchDatasource', () => {
...
@@ -128,6 +130,7 @@ describe('CloudWatchDatasource', () => {
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
targets
:
[
targets
:
[
{
{
refId
:
'A'
,
region
:
'us-east-1'
,
region
:
'us-east-1'
,
namespace
:
'AWS/EC2'
,
namespace
:
'AWS/EC2'
,
metricName
:
'CPUUtilization'
,
metricName
:
'CPUUtilization'
,
...
@@ -178,6 +181,7 @@ describe('CloudWatchDatasource', () => {
...
@@ -178,6 +181,7 @@ describe('CloudWatchDatasource', () => {
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
targets
:
[
targets
:
[
{
{
refId
:
'A'
,
region
:
'default'
,
region
:
'default'
,
namespace
:
'AWS/EC2'
,
namespace
:
'AWS/EC2'
,
metricName
:
'CPUUtilization'
,
metricName
:
'CPUUtilization'
,
...
@@ -203,6 +207,7 @@ describe('CloudWatchDatasource', () => {
...
@@ -203,6 +207,7 @@ describe('CloudWatchDatasource', () => {
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
rangeRaw
:
{
from
:
1483228800
,
to
:
1483232400
},
targets
:
[
targets
:
[
{
{
refId
:
'A'
,
region
:
'us-east-1'
,
region
:
'us-east-1'
,
namespace
:
'AWS/ApplicationELB'
,
namespace
:
'AWS/ApplicationELB'
,
metricName
:
'TargetResponseTime'
,
metricName
:
'TargetResponseTime'
,
...
...
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