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
67ad9035
Commit
67ad9035
authored
Jun 08, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(test metrics): fixed issue with built in Grafana test data source, fixes #5299
parent
36b08027
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
pkg/api/metrics.go
+2
-2
public/app/features/panel/metrics_panel_ctrl.ts
+5
-0
No files found.
pkg/api/metrics.go
View file @
67ad9035
...
...
@@ -12,7 +12,7 @@ import (
"github.com/grafana/grafana/pkg/util"
)
func
GetTestMetrics
(
c
*
middleware
.
Context
)
{
func
GetTestMetrics
(
c
*
middleware
.
Context
)
Response
{
from
:=
c
.
QueryInt64
(
"from"
)
to
:=
c
.
QueryInt64
(
"to"
)
maxDataPoints
:=
c
.
QueryInt64
(
"maxDataPoints"
)
...
...
@@ -37,7 +37,7 @@ func GetTestMetrics(c *middleware.Context) {
result
.
Data
[
seriesIndex
]
.
DataPoints
=
points
}
c
.
JSON
(
200
,
&
result
)
return
Json
(
200
,
&
result
)
}
func
GetInternalMetrics
(
c
*
middleware
.
Context
)
Response
{
...
...
public/app/features/panel/metrics_panel_ctrl.ts
View file @
67ad9035
...
...
@@ -200,6 +200,11 @@ class MetricsPanelCtrl extends PanelCtrl {
this
.
panel
.
snapshotData
=
result
.
data
;
}
if
(
!
result
||
!
result
.
data
)
{
console
.
log
(
'Data source query result invalid, missing data field:'
,
result
);
result
=
{
data
:
[]};
}
return
this
.
events
.
emit
(
'data-received'
,
result
.
data
);
}
...
...
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