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
fc912311
Commit
fc912311
authored
Nov 02, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing tests
parent
33ee85ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
pkg/tsdb/graphite/graphite.go
+0
-1
pkg/tsdb/graphite/graphite_test.go
+10
-12
No files found.
pkg/tsdb/graphite/graphite.go
View file @
fc912311
...
...
@@ -163,6 +163,5 @@ func fixIntervalFormat(target string) string {
target
=
rMonth
.
ReplaceAllStringFunc
(
target
,
func
(
M
string
)
string
{
return
rMon
.
ReplaceAllString
(
M
,
"mon"
)
})
glog
.
Debug
(
"Graphite Query"
,
"target"
,
target
)
return
target
}
pkg/tsdb/graphite/graphite_test.go
View file @
fc912311
...
...
@@ -31,33 +31,31 @@ func TestGraphiteFunctions(t *testing.T) {
Convey
(
"fix interval format in query for 1m"
,
func
()
{
timeRange
:=
f
ormatTimeRange
(
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1m'), 4)"
)
timeRange
:=
f
ixIntervalFormat
(
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1m'), 4)"
)
So
(
timeRange
,
ShouldEqual
,
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1min'), 4)"
)
})
Convey
(
"fix interval format in query for 1M"
,
func
()
{
timeRange
:=
f
ormatTimeRange
(
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1M'), 4)"
)
timeRange
:=
f
ixIntervalFormat
(
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1M'), 4)"
)
So
(
timeRange
,
ShouldEqual
,
"aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1mon'), 4)"
)
})
/*
Convey("should not override query", func() {
Convey
(
"should not override query for 1M"
,
func
()
{
timeRange := formatTimeRange
("app.grafana.*.dashboards.views.1M.count")
So(timeRange, ShouldEqual, "app.grafana.*.dashboards.views.1M.count")
timeRange
:=
fixIntervalFormat
(
"app.grafana.*.dashboards.views.1M.count"
)
So
(
timeRange
,
ShouldEqual
,
"app.grafana.*.dashboards.views.1M.count"
)
})
})
Convey("should not override query
", func() {
Convey
(
"should not override query for 1m
"
,
func
()
{
timeRange := formatTimeRange
("app.grafana.*.dashboards.views.1m.count")
So(timeRange, ShouldEqual, "app.grafana.*.dashboards.views.1m.count")
timeRange
:=
fixIntervalFormat
(
"app.grafana.*.dashboards.views.1m.count"
)
So
(
timeRange
,
ShouldEqual
,
"app.grafana.*.dashboards.views.1m.count"
)
})
})
*/
})
}
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