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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
40b80af3
Commit
40b80af3
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Add a debug GetRunningProcesses to bindings
parent
492b1a40
No related branches found
No related tags found
3 merge requests
!510
Release
,
!381
Initial CTIDH
,
!378
Add a debug GetRunningProcesses to bindings
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/follow.go
+6
-0
6 additions, 0 deletions
bindings/follow.go
stoppable/multi.go
+23
-2
23 additions, 2 deletions
stoppable/multi.go
xxdk/cmix.go
+6
-0
6 additions, 0 deletions
xxdk/cmix.go
with
35 additions
and
2 deletions
bindings/follow.go
+
6
−
0
View file @
40b80af3
...
@@ -136,6 +136,12 @@ func (c *Cmix) IsHealthy() bool {
...
@@ -136,6 +136,12 @@ func (c *Cmix) IsHealthy() bool {
return
c
.
api
.
GetCmix
()
.
IsHealthy
()
return
c
.
api
.
GetCmix
()
.
IsHealthy
()
}
}
// GetRunningProcesses returns the name of all running processes at the time
// of this call.
func
(
c
*
Cmix
)
GetRunningProcesses
()
[]
string
{
return
c
.
api
.
GetRunningProcesses
()
}
// NetworkHealthCallback contains a callback that is used to receive
// NetworkHealthCallback contains a callback that is used to receive
// notification if network health changes.
// notification if network health changes.
type
NetworkHealthCallback
interface
{
type
NetworkHealthCallback
interface
{
...
...
This diff is collapsed.
Click to expand it.
stoppable/multi.go
+
23
−
2
View file @
40b80af3
...
@@ -61,10 +61,13 @@ func (m *Multi) GetStatus() Status {
...
@@ -61,10 +61,13 @@ func (m *Multi) GetStatus() Status {
lowestStatus
:=
Stopped
lowestStatus
:=
Stopped
m
.
mux
.
RLock
()
m
.
mux
.
RLock
()
for
_
,
s
:=
range
m
.
stoppables
{
for
i
:=
range
m
.
stoppables
{
s
:=
m
.
stoppables
[
i
]
status
:=
s
.
GetStatus
()
status
:=
s
.
GetStatus
()
if
status
<
lowestStatus
{
if
status
<
lowestStatus
{
lowestStatus
=
status
lowestStatus
=
status
jww
.
DEBUG
.
Printf
(
"Stoppable %s has status %s"
,
s
.
Name
(),
status
.
String
())
}
}
}
}
...
@@ -73,6 +76,24 @@ func (m *Multi) GetStatus() Status {
...
@@ -73,6 +76,24 @@ func (m *Multi) GetStatus() Status {
return
lowestStatus
return
lowestStatus
}
}
// GetRunningProcesses returns a list of running Stoppable processes.
func
(
m
*
Multi
)
GetRunningProcesses
()
[]
string
{
m
.
mux
.
RLock
()
runningProcesses
:=
make
([]
string
,
0
)
for
i
:=
range
m
.
stoppables
{
s
:=
m
.
stoppables
[
i
]
status
:=
s
.
GetStatus
()
if
status
<
Stopped
{
runningProcesses
=
append
(
runningProcesses
,
s
.
Name
())
}
}
m
.
mux
.
RUnlock
()
return
runningProcesses
}
// IsRunning returns true if Stoppable is marked as running.
// IsRunning returns true if Stoppable is marked as running.
func
(
m
*
Multi
)
IsRunning
()
bool
{
func
(
m
*
Multi
)
IsRunning
()
bool
{
return
m
.
GetStatus
()
==
Running
return
m
.
GetStatus
()
==
Running
...
@@ -90,7 +111,7 @@ func (m *Multi) IsStopped() bool {
...
@@ -90,7 +111,7 @@ func (m *Multi) IsStopped() bool {
// Close issues a close signal to all child stoppables and marks the status of
// Close issues a close signal to all child stoppables and marks the status of
// the Multi Stoppable as stopping. Returns an error if one or more child
// the Multi Stoppable as stopping. Returns an error if one or more child
// stoppables failed to close but it does not return their specific errors and
// stoppables failed to close
,
but it does not return their specific errors and
// assumes they print them to the log.
// assumes they print them to the log.
func
(
m
*
Multi
)
Close
()
error
{
func
(
m
*
Multi
)
Close
()
error
{
var
numErrors
uint32
var
numErrors
uint32
...
...
This diff is collapsed.
Click to expand it.
xxdk/cmix.go
+
6
−
0
View file @
40b80af3
...
@@ -397,6 +397,12 @@ func (c *Cmix) HasRunningProcessies() bool {
...
@@ -397,6 +397,12 @@ func (c *Cmix) HasRunningProcessies() bool {
return
!
c
.
followerServices
.
stoppable
.
IsStopped
()
return
!
c
.
followerServices
.
stoppable
.
IsStopped
()
}
}
// GetRunningProcesses returns the name of all running processes at the time
// of this call.
func
(
c
*
Cmix
)
GetRunningProcesses
()
[]
string
{
return
c
.
followerServices
.
stoppable
.
GetRunningProcesses
()
}
// GetRoundEvents registers a callback for round events.
// GetRoundEvents registers a callback for round events.
func
(
c
*
Cmix
)
GetRoundEvents
()
interfaces
.
RoundEvents
{
func
(
c
*
Cmix
)
GetRoundEvents
()
interfaces
.
RoundEvents
{
jww
.
INFO
.
Printf
(
"GetRoundEvents()"
)
jww
.
INFO
.
Printf
(
"GetRoundEvents()"
)
...
...
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