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
68d4211c
Commit
68d4211c
authored
Nov 30, 2017
by
Andrei Kalasok
Committed by
Andrei Kalasok
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana-10039: fix query time range ends in the past
parent
603725ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
pkg/tsdb/graphite/graphite.go
+2
-2
pkg/tsdb/graphite/graphite_test.go
+2
-2
No files found.
pkg/tsdb/graphite/graphite.go
View file @
68d4211c
...
@@ -17,7 +17,7 @@ import (
...
@@ -17,7 +17,7 @@ import (
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb"
"github.com/grafana/grafana/pkg/tsdb"
opentracing
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go"
)
)
type
GraphiteExecutor
struct
{
type
GraphiteExecutor
struct
{
...
@@ -158,7 +158,7 @@ func formatTimeRange(input string) string {
...
@@ -158,7 +158,7 @@ func formatTimeRange(input string) string {
if
input
==
"now"
{
if
input
==
"now"
{
return
input
return
input
}
}
return
strings
.
Replace
(
strings
.
Replace
(
input
,
"m"
,
"min"
,
-
1
),
"M"
,
"mon"
,
-
1
)
return
strings
.
Replace
(
strings
.
Replace
(
strings
.
Replace
(
input
,
"now"
,
""
,
-
1
)
,
"m"
,
"min"
,
-
1
),
"M"
,
"mon"
,
-
1
)
}
}
func
fixIntervalFormat
(
target
string
)
string
{
func
fixIntervalFormat
(
target
string
)
string
{
...
...
pkg/tsdb/graphite/graphite_test.go
View file @
68d4211c
...
@@ -18,14 +18,14 @@ func TestGraphiteFunctions(t *testing.T) {
...
@@ -18,14 +18,14 @@ func TestGraphiteFunctions(t *testing.T) {
Convey
(
"formatting time range for now-1m"
,
func
()
{
Convey
(
"formatting time range for now-1m"
,
func
()
{
timeRange
:=
formatTimeRange
(
"now-1m"
)
timeRange
:=
formatTimeRange
(
"now-1m"
)
So
(
timeRange
,
ShouldEqual
,
"
now
-1min"
)
So
(
timeRange
,
ShouldEqual
,
"-1min"
)
})
})
Convey
(
"formatting time range for now-1M"
,
func
()
{
Convey
(
"formatting time range for now-1M"
,
func
()
{
timeRange
:=
formatTimeRange
(
"now-1M"
)
timeRange
:=
formatTimeRange
(
"now-1M"
)
So
(
timeRange
,
ShouldEqual
,
"
now
-1mon"
)
So
(
timeRange
,
ShouldEqual
,
"-1mon"
)
})
})
...
...
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