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
d57ffad5
Commit
d57ffad5
authored
Apr 19, 2015
by
Masaori Koshiba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a space between arguments
parent
32275cb0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
public/app/plugins/datasource/kairosdb/datasource.js
+11
-11
public/app/plugins/datasource/kairosdb/queryCtrl.js
+3
-3
No files found.
public/app/plugins/datasource/kairosdb/datasource.js
View file @
d57ffad5
...
...
@@ -44,7 +44,7 @@ function (angular, _, kbn) {
d
.
resolve
({
data
:
[]
});
return
d
.
promise
;
}
return
this
.
performTimeSeriesQuery
(
queries
,
start
,
end
).
then
(
handleKairosDBQueryResponseAlias
,
handleQueryError
);
return
this
.
performTimeSeriesQuery
(
queries
,
start
,
end
).
then
(
handleKairosDBQueryResponseAlias
,
handleQueryError
);
};
///////////////////////////////////////////////////////////////////////
...
...
@@ -56,8 +56,8 @@ function (angular, _, kbn) {
metrics
:
queries
};
reqBody
.
cache_time
=
0
;
convertToKairosTime
(
start
,
reqBody
,
'start'
);
convertToKairosTime
(
end
,
reqBody
,
'end'
);
convertToKairosTime
(
start
,
reqBody
,
'start'
);
convertToKairosTime
(
end
,
reqBody
,
'end'
);
var
options
=
{
method
:
'POST'
,
url
:
'/api/v1/datapoints/query'
,
...
...
@@ -86,10 +86,10 @@ function (angular, _, kbn) {
};
KairosDBDatasource
.
prototype
.
performTagSuggestQuery
=
function
(
metricname
,
range
,
type
,
keyValue
)
{
KairosDBDatasource
.
prototype
.
performTagSuggestQuery
=
function
(
metricname
,
range
,
type
,
keyValue
)
{
if
(
tagList
&&
(
metricname
===
tagList
.
metricName
)
&&
(
range
.
from
===
tagList
.
range
.
from
)
&&
(
range
.
to
===
tagList
.
range
.
to
))
{
return
getTagListFromResponse
(
tagList
.
results
,
type
,
keyValue
);
return
getTagListFromResponse
(
tagList
.
results
,
type
,
keyValue
);
}
tagList
=
{
metricName
:
metricname
,
...
...
@@ -98,8 +98,8 @@ function (angular, _, kbn) {
var
body
=
{
metrics
:
[{
name
:
metricname
}]
};
convertToKairosTime
(
range
.
from
,
body
,
'start'
);
convertToKairosTime
(
range
.
to
,
body
,
'end'
);
convertToKairosTime
(
range
.
from
,
body
,
'start'
);
convertToKairosTime
(
range
.
to
,
body
,
'end'
);
var
options
=
{
url
:
this
.
url
+
'/api/v1/datapoints/query/tags'
,
method
:
'POST'
,
...
...
@@ -107,7 +107,7 @@ function (angular, _, kbn) {
};
return
$http
(
options
).
then
(
function
(
results
)
{
tagList
.
results
=
results
;
return
getTagListFromResponse
(
results
,
type
,
keyValue
);
return
getTagListFromResponse
(
results
,
type
,
keyValue
);
});
};
...
...
@@ -116,14 +116,14 @@ function (angular, _, kbn) {
/// Formatting methods
////////////////////////////////////////////////////////////////////////
function
getTagListFromResponse
(
results
,
type
,
keyValue
)
{
function
getTagListFromResponse
(
results
,
type
,
keyValue
)
{
if
(
!
results
.
data
)
{
return
[];
}
if
(
type
===
"key"
)
{
return
_
.
keys
(
results
.
data
.
queries
[
0
].
results
[
0
].
tags
);
}
else
if
(
type
===
"value"
&&
_
.
has
(
results
.
data
.
queries
[
0
].
results
[
0
].
tags
,
keyValue
))
{
else
if
(
type
===
"value"
&&
_
.
has
(
results
.
data
.
queries
[
0
].
results
[
0
].
tags
,
keyValue
))
{
return
results
.
data
.
queries
[
0
].
results
[
0
].
tags
[
keyValue
];
}
return
[];
...
...
@@ -194,7 +194,7 @@ function (angular, _, kbn) {
return
output2
;
}
function
convertTargetToQuery
(
options
,
target
)
{
function
convertTargetToQuery
(
options
,
target
)
{
if
(
!
target
.
metric
||
target
.
hide
)
{
return
null
;
}
...
...
public/app/plugins/datasource/kairosdb/queryCtrl.js
View file @
d57ffad5
...
...
@@ -72,12 +72,12 @@ function (angular, _) {
};
$scope
.
suggestTagKeys
=
function
(
query
,
callback
)
{
callback
(
$scope
.
datasource
.
performTagSuggestQuery
(
$scope
.
target
.
metric
,
$scope
.
rangeUnparsed
,
'key'
,
''
));
callback
(
$scope
.
datasource
.
performTagSuggestQuery
(
$scope
.
target
.
metric
,
$scope
.
rangeUnparsed
,
'key'
,
''
));
};
$scope
.
suggestTagValues
=
function
(
query
,
callback
)
{
callback
(
$scope
.
datasource
.
performTagSuggestQuery
(
$scope
.
target
.
metric
,
$scope
.
rangeUnparsed
,
'value'
,
$scope
.
target
.
currentTagKey
));
.
performTagSuggestQuery
(
$scope
.
target
.
metric
,
$scope
.
rangeUnparsed
,
'value'
,
$scope
.
target
.
currentTagKey
));
};
// Filter metric by tag
...
...
@@ -94,7 +94,7 @@ function (angular, _) {
$scope
.
validateFilterTag
();
if
(
!
$scope
.
target
.
errors
.
tags
)
{
if
(
!
_
.
has
(
$scope
.
target
.
tags
,
$scope
.
target
.
currentTagKey
))
{
if
(
!
_
.
has
(
$scope
.
target
.
tags
,
$scope
.
target
.
currentTagKey
))
{
$scope
.
target
.
tags
[
$scope
.
target
.
currentTagKey
]
=
[];
}
$scope
.
target
.
tags
[
$scope
.
target
.
currentTagKey
].
push
(
$scope
.
target
.
currentTagValue
);
...
...
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