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
a9b7ca86
Commit
a9b7ca86
authored
2 years ago
by
benjamin
Browse files
Options
Downloads
Patches
Plain Diff
fixed isready so the float doesnt go above 100
parent
b5218334
No related branches found
No related tags found
2 merge requests
!510
Release
,
!432
Control node reg
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xxdk/cmix.go
+3
-2
3 additions, 2 deletions
xxdk/cmix.go
with
3 additions
and
2 deletions
xxdk/cmix.go
+
3
−
2
View file @
a9b7ca86
...
@@ -484,8 +484,6 @@ func (c *Cmix) GetNodeRegistrationStatus() (int, int, error) {
...
@@ -484,8 +484,6 @@ func (c *Cmix) GetNodeRegistrationStatus() (int, int, error) {
return
numRegistered
,
len
(
nodes
)
-
numStale
,
nil
return
numRegistered
,
len
(
nodes
)
-
numStale
,
nil
}
}
// IsReady returns true if at least percentReady of node registrations has
// IsReady returns true if at least percentReady of node registrations has
// completed. If not all have completed, then it returns false and howClose will
// completed. If not all have completed, then it returns false and howClose will
// be a percent (0-1) of node registrations completed.
// be a percent (0-1) of node registrations completed.
...
@@ -502,6 +500,9 @@ func (c *Cmix) IsReady(percentReady float64) (isReady bool, howClose float64) {
...
@@ -502,6 +500,9 @@ func (c *Cmix) IsReady(percentReady float64) (isReady bool, howClose float64) {
isReady
=
(
float64
(
numReg
)
/
float64
(
numNodes
))
>=
percentReady
isReady
=
(
float64
(
numReg
)
/
float64
(
numNodes
))
>=
percentReady
howClose
=
float64
(
numReg
)
/
(
float64
(
numNodes
)
*
percentReady
)
howClose
=
float64
(
numReg
)
/
(
float64
(
numNodes
)
*
percentReady
)
if
howClose
>
1
{
howClose
=
1
}
return
isReady
,
howClose
return
isReady
,
howClose
}
}
...
...
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