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
16b0d797
Commit
16b0d797
authored
Dec 16, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load all metrics now works
parent
1cbe067b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
grafana.sublime-workspace
+0
-0
src/app/controllers/metricKeys.js
+25
-3
No files found.
grafana.sublime-workspace
View file @
16b0d797
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/app/controllers/metricKeys.js
View file @
16b0d797
...
...
@@ -44,15 +44,37 @@ function (angular, _, config) {
};
$scope
.
loadAll
=
function
()
{
return
$http
.
get
(
config
.
graphiteUrl
+
"/metrics/index.json"
)
.
then
(
function
(
data
)
{
$scope
.
infoText
=
"Fetching all metrics from graphite..."
;
return
$http
.
get
(
config
.
graphiteUrl
+
"/metrics/index.json"
)
.
then
(
saveMetricsArray
)
.
then
(
function
()
{
$scope
.
infoText
=
"Indexing complete!"
;
})
.
then
(
null
,
function
(
err
)
{
$scope
.
errorText
=
"Failed to fetch index.json metrics file from graphite: "
+
err
;
$scope
.
errorText
=
err
;
deferred
.
reject
(
err
);
});
};
function
saveMetricsArray
(
data
,
currentIndex
)
{
if
(
!
data
&&
!
data
.
data
&&
!
data
.
data
.
length
==
0
)
{
return
$q
.
reject
(
'No metrics from graphite'
);
}
if
(
data
.
data
.
length
===
currentIndex
)
{
return
$q
.
when
(
'done'
);
}
currentIndex
=
currentIndex
||
0
;
return
saveMetricKey
(
data
.
data
[
currentIndex
])
.
then
(
function
()
{
return
saveMetricsArray
(
data
,
currentIndex
+
1
);
});
}
function
deleteIndex
()
{
var
deferred
=
$q
.
defer
();
...
...
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