Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-flow-metrics
Commits
390a88b7
Commit
390a88b7
authored
Dec 12, 2017
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the example compile...
parent
cc546389
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
meter_test.go
meter_test.go
+5
-1
No files found.
meter_test.go
View file @
390a88b7
...
@@ -25,6 +25,10 @@ func ExampleMeter() {
...
@@ -25,6 +25,10 @@ func ExampleMeter() {
// Get the current total.
// Get the current total.
total
:=
meter
.
Snapshot
()
.
Total
total
:=
meter
.
Snapshot
()
.
Total
fmt
.
Printf
(
"%d (%d/s)
\n
"
,
total
,
int64
(
math
.
Round
(
float64
(
rate
)
/
10
)
))
fmt
.
Printf
(
"%d (%d/s)
\n
"
,
total
,
roundTens
(
rate
))
// Output: 3000 (300/s)
// Output: 3000 (300/s)
}
}
func
roundTens
(
x
float64
)
int64
{
return
int64
(
math
.
Floor
(
x
/
10
+
0.5
))
*
10
}
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