Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
client
Commits
778923e4
Commit
778923e4
authored
May 24, 2021
by
Benjamin Wenger
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/profiling' into 'release'
CPU Profiling See merge request
!626
parents
2b0c3808
0c76f813
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!23
Release
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/root.go
+17
-0
17 additions, 0 deletions
cmd/root.go
with
17 additions
and
0 deletions
cmd/root.go
+
17
−
0
View file @
778923e4
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
"io/ioutil"
"io/ioutil"
"log"
"log"
"os"
"os"
"runtime/pprof"
"strconv"
"strconv"
"strings"
"strings"
"time"
"time"
...
@@ -46,6 +47,14 @@ var rootCmd = &cobra.Command{
...
@@ -46,6 +47,14 @@ var rootCmd = &cobra.Command{
Short
:
"Runs a client for cMix anonymous communication platform"
,
Short
:
"Runs a client for cMix anonymous communication platform"
,
Args
:
cobra
.
NoArgs
,
Args
:
cobra
.
NoArgs
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
profileOut
:=
viper
.
GetString
(
"profile-cpu"
)
if
profileOut
!=
""
{
f
,
err
:=
os
.
Create
(
profileOut
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"%+v"
,
err
)
}
pprof
.
StartCPUProfile
(
f
)
}
client
:=
initClient
()
client
:=
initClient
()
...
@@ -262,6 +271,10 @@ var rootCmd = &cobra.Command{
...
@@ -262,6 +271,10 @@ var rootCmd = &cobra.Command{
"Failed to cleanly close threads: %+v
\n
"
,
"Failed to cleanly close threads: %+v
\n
"
,
err
)
err
)
}
}
if
profileOut
!=
""
{
pprof
.
StopCPUProfile
()
}
},
},
}
}
...
@@ -770,6 +783,10 @@ func init() {
...
@@ -770,6 +783,10 @@ func init() {
""
,
uint
(
defaultE2EParams
.
NumRekeys
),
""
,
uint
(
defaultE2EParams
.
NumRekeys
),
"Number of rekeys reserved for rekey operations"
)
"Number of rekeys reserved for rekey operations"
)
viper
.
BindPFlag
(
"e2eNumReKeys"
,
rootCmd
.
Flags
()
.
Lookup
(
"e2eNumReKeys"
))
viper
.
BindPFlag
(
"e2eNumReKeys"
,
rootCmd
.
Flags
()
.
Lookup
(
"e2eNumReKeys"
))
rootCmd
.
Flags
()
.
String
(
"profile-cpu"
,
""
,
"Enable cpu profiling to this file"
)
viper
.
BindPFlag
(
"profile-cpu"
,
rootCmd
.
Flags
()
.
Lookup
(
"profile-cpu"
))
}
}
// initConfig reads in config file and ENV variables if set.
// initConfig reads in config file and ENV variables if set.
...
...
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