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
2c43fdc4
Commit
2c43fdc4
authored
May 15, 2014
by
Harald Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Tetha/grafana
parents
2a6a3a3a
52e1f527
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/app/controllers/metricKeys.js
+14
-6
No files found.
src/app/controllers/metricKeys.js
View file @
2c43fdc4
...
...
@@ -52,16 +52,23 @@ function (angular, _, config) {
$scope
.
loadAll
=
function
()
{
$scope
.
infoText
=
"Fetching all metrics from graphite..."
;
return
$http
.
get
(
config
.
graphiteUrl
+
"/metrics/index.json"
)
.
then
(
saveMetricsArray
)
.
then
(
function
()
{
getFromEachGraphite
(
'/metrics/index.json'
,
saveMetricsArray
)
.
then
(
function
()
{
$scope
.
infoText
=
"Indexing complete!"
;
})
.
then
(
null
,
function
(
err
)
{
}).
then
(
null
,
function
(
err
)
{
$scope
.
errorText
=
err
;
});
};
function
getFromEachGraphite
(
request
,
data_callback
,
error_callback
)
{
return
$q
.
all
(
_
.
map
(
config
.
datasources
,
function
(
datasource
)
{
if
(
datasource
.
type
=
'graphite'
)
{
return
$http
.
get
(
datasource
.
url
+
request
)
.
then
(
data_callback
,
error_callback
);
}
}
)
);
}
function
saveMetricsArray
(
data
,
currentIndex
)
{
if
(
!
data
&&
!
data
.
data
&&
data
.
data
.
length
===
0
)
{
...
...
@@ -80,6 +87,7 @@ function (angular, _, config) {
});
}
function
deleteIndex
()
{
var
deferred
=
$q
.
defer
();
...
...
@@ -172,7 +180,7 @@ function (angular, _, config) {
function
loadMetricsRecursive
(
metricPath
)
{
return
$http
.
get
(
config
.
graphiteUrl
+
'/metrics/find/?query='
+
metricPath
).
then
(
receiveMetric
);
return
getFromEachGraphite
(
'/metrics/find/?query='
+
metricPath
,
receiveMetric
);
}
});
...
...
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