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
8243ac39
Commit
8243ac39
authored
Sep 24, 2017
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix parameter format
parent
fe1d395d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
pkg/tsdb/cloudwatch/cloudwatch.go
+1
-1
public/app/plugins/datasource/cloudwatch/datasource.js
+5
-7
public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts
+6
-7
No files found.
pkg/tsdb/cloudwatch/cloudwatch.go
View file @
8243ac39
...
...
@@ -87,7 +87,7 @@ func (e *CloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, queryCo
}
currentlyExecuting
++
go
func
(
refId
string
,
index
int
)
{
queryRes
,
err
:=
e
.
executeQuery
(
ctx
,
queryContext
.
Queries
[
index
]
.
Model
.
Get
(
"parameters"
)
,
queryContext
)
queryRes
,
err
:=
e
.
executeQuery
(
ctx
,
queryContext
.
Queries
[
index
]
.
Model
,
queryContext
)
currentlyExecuting
--
if
err
!=
nil
{
errCh
<-
err
...
...
public/app/plugins/datasource/cloudwatch/datasource.js
View file @
8243ac39
...
...
@@ -48,14 +48,13 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
item
.
dimensions
=
dimensions
;
item
.
period
=
self
.
getPeriod
(
item
,
options
);
return
{
return
_
.
extend
(
{
refId
:
item
.
refId
,
intervalMs
:
options
.
intervalMs
,
maxDataPoints
:
options
.
maxDataPoints
,
datasourceId
:
self
.
instanceSettings
.
id
,
type
:
'timeSeriesQuery'
,
parameters
:
item
};
},
item
);
});
// No valid targets, return the empty result to save a round trip.
...
...
@@ -147,15 +146,14 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
from
:
range
.
from
,
to
:
range
.
to
,
queries
:
[
{
_
.
extend
(
{
refId
:
'metricFindQuery'
,
intervalMs
:
1
,
// dummy
maxDataPoints
:
1
,
// dummy
datasourceId
:
this
.
instanceSettings
.
id
,
type
:
'metricFindQuery'
,
subtype
:
subtype
,
parameters
:
parameters
}
subtype
:
subtype
},
parameters
)
]
}).
then
(
function
(
r
)
{
return
transformSuggestDataFromTable
(
r
);
});
};
...
...
public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts
View file @
8243ac39
import
"../datasource"
;
import
{
describe
,
beforeEach
,
it
,
expect
,
angularMocks
}
from
'test/lib/common'
;
import
helpers
from
'test/specs/helpers'
;
...
...
@@ -76,11 +75,11 @@ describe('CloudWatchDatasource', function() {
it
(
'should generate the correct query'
,
function
(
done
)
{
ctx
.
ds
.
query
(
query
).
then
(
function
()
{
var
params
=
requestParams
.
queries
[
0
];
expect
(
params
.
parameters
.
namespace
).
to
.
be
(
query
.
targets
[
0
].
namespace
);
expect
(
params
.
parameters
.
metricName
).
to
.
be
(
query
.
targets
[
0
].
metricName
);
expect
(
params
.
parameters
.
dimensions
[
'InstanceId'
]).
to
.
be
(
'i-12345678'
);
expect
(
params
.
parameters
.
statistics
).
to
.
eql
(
query
.
targets
[
0
].
statistics
);
expect
(
params
.
p
arameters
.
p
eriod
).
to
.
be
(
query
.
targets
[
0
].
period
);
expect
(
params
.
namespace
).
to
.
be
(
query
.
targets
[
0
].
namespace
);
expect
(
params
.
metricName
).
to
.
be
(
query
.
targets
[
0
].
metricName
);
expect
(
params
.
dimensions
[
'InstanceId'
]).
to
.
be
(
'i-12345678'
);
expect
(
params
.
statistics
).
to
.
eql
(
query
.
targets
[
0
].
statistics
);
expect
(
params
.
period
).
to
.
be
(
query
.
targets
[
0
].
period
);
done
();
});
ctx
.
$rootScope
.
$apply
();
...
...
@@ -110,7 +109,7 @@ describe('CloudWatchDatasource', function() {
ctx
.
ds
.
query
(
query
).
then
(
function
()
{
var
params
=
requestParams
.
queries
[
0
];
expect
(
params
.
p
arameters
.
p
eriod
).
to
.
be
(
600
);
expect
(
params
.
period
).
to
.
be
(
600
);
done
();
});
ctx
.
$rootScope
.
$apply
();
...
...
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