Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishapi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishapi
Commits
a71b26db
Commit
a71b26db
authored
Aug 20, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stats.Read() returns human-readable strings.
parent
73c9c3c6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
e2e_test.go
pkg/stats/e2e_test.go
+4
-4
stats.go
pkg/stats/stats.go
+13
-2
No files found.
pkg/stats/e2e_test.go
View file @
a71b26db
...
@@ -51,10 +51,10 @@ var (
...
@@ -51,10 +51,10 @@ var (
expStats
=
[
...
]
string
{
"MGT.uptime"
,
"MAIN.uptime"
,
"MAIN.n_vcl"
}
expStats
=
[
...
]
string
{
"MGT.uptime"
,
"MAIN.uptime"
,
"MAIN.n_vcl"
}
errStats
=
[
...
]
string
{
"foo"
,
"bar"
,
"baz"
,
"quux"
}
errStats
=
[
...
]
string
{
"foo"
,
"bar"
,
"baz"
,
"quux"
}
s7sn
=
map
[
Semantics
]
expRuneStr
{
s7sn
=
map
[
Semantics
]
expRuneStr
{
Counter
:
{
'c'
,
"c"
},
Counter
:
{
'c'
,
"c
ounter
"
},
Gauge
:
{
'g'
,
"g"
},
Gauge
:
{
'g'
,
"g
auge
"
},
S7sBitmap
:
{
'b'
,
"b"
},
S7sBitmap
:
{
'b'
,
"b
itmap
"
},
S7sUnknown
:
{
'?'
,
"
?
"
},
S7sUnknown
:
{
'?'
,
"
unknown
"
},
}
}
formats
=
map
[
Format
]
expRuneStr
{
formats
=
map
[
Format
]
expRuneStr
{
Integer
:
{
'i'
,
"i"
},
Integer
:
{
'i'
,
"i"
},
...
...
pkg/stats/stats.go
View file @
a71b26db
...
@@ -72,9 +72,20 @@ const (
...
@@ -72,9 +72,20 @@ const (
S7sUnknown
=
Semantics
(
'?'
)
S7sUnknown
=
Semantics
(
'?'
)
)
)
// String returns "c
", "g", "b" or "?
".
// String returns "c
ounter", "gauge", "bitmap" or "unknown
".
func
(
s
Semantics
)
String
()
string
{
func
(
s
Semantics
)
String
()
string
{
return
string
(
s
)
switch
(
s
)
{
case
Counter
:
return
"counter"
case
Gauge
:
return
"gauge"
case
S7sBitmap
:
return
"bitmap"
case
S7sUnknown
:
return
"unknown"
default
:
return
"invalid status"
}
}
}
// Format indicates the display format suitable for the kind of data
// Format indicates the display format suitable for the kind of 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