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
a4a2e35b
Commit
a4a2e35b
authored
Nov 02, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verified interval format function and gofmt check
parent
2088363b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
pkg/tsdb/graphite/graphite.go
+4
-3
pkg/tsdb/graphite/graphite_test.go
+1
-1
No files found.
pkg/tsdb/graphite/graphite.go
View file @
a4a2e35b
...
...
@@ -9,9 +9,9 @@ import (
"net/http"
"net/url"
"path"
"regexp"
"strings"
"time"
"regexp"
"golang.org/x/net/context/ctxhttp"
...
...
@@ -153,15 +153,16 @@ func formatTimeRange(input string) string {
}
func
fixIntervalFormat
(
target
string
)
string
{
rMinute
:=
regexp
.
MustCompile
(
"'(
\\
d+)m'"
)
rMinute
:=
regexp
.
MustCompile
(
`'(\d+)m'`
)
rMin
:=
regexp
.
MustCompile
(
"m"
)
target
=
rMinute
.
ReplaceAllStringFunc
(
target
,
func
(
m
string
)
string
{
return
rMin
.
ReplaceAllString
(
m
,
"min"
)
})
rMonth
:=
regexp
.
MustCompile
(
"'(
\\
d+)M'"
)
rMonth
:=
regexp
.
MustCompile
(
`'(\d+)M'`
)
rMon
:=
regexp
.
MustCompile
(
"M"
)
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 @
a4a2e35b
...
...
@@ -6,7 +6,7 @@ import (
)
func
TestGraphiteFunctions
(
t
*
testing
.
T
)
{
Convey
(
"Testing Graphite
Executor
"
,
t
,
func
()
{
Convey
(
"Testing Graphite
Functions
"
,
t
,
func
()
{
Convey
(
"formatting time range for now"
,
func
()
{
...
...
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