Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
server
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
server
Commits
1acc81da
Commit
1acc81da
authored
Mar 8, 2018
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
add timing info to benchmark command
parent
26337528
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/benchmark.go
+12
-0
12 additions, 0 deletions
cmd/benchmark.go
with
12 additions
and
0 deletions
cmd/benchmark.go
+
12
−
0
View file @
1acc81da
...
@@ -3,6 +3,8 @@ package cmd
...
@@ -3,6 +3,8 @@ package cmd
import
(
import
(
"gitlab.com/privategrity/server/benchmark"
"gitlab.com/privategrity/server/benchmark"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"time"
"fmt"
)
)
var
benchBatchSize
uint64
var
benchBatchSize
uint64
...
@@ -25,7 +27,17 @@ var benchmarkCmd = &cobra.Command{
...
@@ -25,7 +27,17 @@ var benchmarkCmd = &cobra.Command{
Short
:
"Server benchmarking tests"
,
Short
:
"Server benchmarking tests"
,
Long
:
`Run internal benchmark funcs by specifying node and batch sizes`
,
Long
:
`Run internal benchmark funcs by specifying node and batch sizes`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
fmt
.
Printf
(
"Running benchmarks for %d nodes with %d batch size and %d"
+
" iterations...
\n
"
,
nodeCount
,
benchBatchSize
,
iterations
)
start
:=
time
.
Now
()
benchmark
.
PrecompIterations
(
nodeCount
,
benchBatchSize
,
iterations
)
benchmark
.
PrecompIterations
(
nodeCount
,
benchBatchSize
,
iterations
)
precompDelta
:=
(
float64
(
time
.
Since
(
start
))
/
1000000000
)
/
float64
(
iterations
)
fmt
.
Printf
(
"Precomp took an average of %f s
\n
"
,
precompDelta
)
start
=
time
.
Now
()
benchmark
.
RealtimeIterations
(
nodeCount
,
benchBatchSize
,
iterations
)
benchmark
.
RealtimeIterations
(
nodeCount
,
benchBatchSize
,
iterations
)
realtimeDelta
:=
(
float64
(
time
.
Since
(
start
))
/
1000000000
)
/
float64
(
iterations
)
fmt
.
Printf
(
"Realtime took an average of %f s
\n
"
,
realtimeDelta
)
},
},
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment