Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
juga
sbws
Commits
821f86e8
Commit
821f86e8
authored
6 years ago
by
juga
Browse files
Options
Downloads
Plain Diff
Merge branch 'ticket28365'
parents
a62801fd
a011c93f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
sbws/lib/v3bwfile.py
+2
-3
2 additions, 3 deletions
sbws/lib/v3bwfile.py
tests/unit/lib/test_v3bwfile.py
+9
-2
9 additions, 2 deletions
tests/unit/lib/test_v3bwfile.py
with
13 additions
and
5 deletions
CHANGELOG.md
+
2
−
0
View file @
821f86e8
...
...
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
-
Change default directories when sbws is run from a system service (#28268).
-
Include the headers about eligible relays in all the bandwidth files,
not only in the ones that does not have enough eligible relays (#28365).
## [1.0.0] - 2018-10-29
...
...
This diff is collapsed.
Click to expand it.
sbws/lib/v3bwfile.py
+
2
−
3
View file @
821f86e8
...
...
@@ -896,10 +896,9 @@ class V3BWFile(object):
if
number_consensus_relays
is
not
None
:
statsd
,
success
=
self
.
measured_progress_stats
(
bw_lines
,
number_consensus_relays
,
min_perc_reached_before
)
# add statistics about progress
only when there are not enough
# measured relays. Should some stats be added always?
# add statistics about progress
always
header
.
add_stats
(
**
statsd
)
if
not
success
:
header
.
add_stats
(
**
statsd
)
bw_lines
=
[]
state
[
'
min_perc_reached
'
]
=
None
else
:
...
...
This diff is collapsed.
Click to expand it.
tests/unit/lib/test_v3bwfile.py
+
9
−
2
View file @
821f86e8
...
...
@@ -4,7 +4,8 @@ import json
import
os.path
from
sbws
import
__version__
as
version
from
sbws.globals
import
SPEC_VERSION
,
SBWS_SCALING
,
TORFLOW_SCALING
from
sbws.globals
import
(
SPEC_VERSION
,
SBWS_SCALING
,
TORFLOW_SCALING
,
MIN_REPORT
)
from
sbws.lib.resultdump
import
Result
,
load_result_file
,
ResultSuccess
from
sbws.lib.v3bwfile
import
(
V3BWHeader
,
V3BWLine
,
TERMINATOR
,
LINE_SEP
,
KEYVALUE_SEP_V1
,
num_results_of_type
,
...
...
@@ -234,9 +235,15 @@ def test_update_progress(datadir, tmpdir):
state
)
assert
header
.
percent_eligible_relays
==
'
50
'
assert
state
.
get
(
'
min_perc_reached
'
)
is
None
# Test that the headers are also included when there are enough eligible
# relays
number_consensus_relays
=
3
header
=
V3BWHeader
(
str
(
now_unixts
()))
bwfile
.
update_progress
(
bw_lines_raw
,
header
,
number_consensus_relays
,
state
)
assert
state
.
get
(
'
min_perc_reached
'
)
==
now_isodt_str
()
assert
not
hasattr
(
header
,
'
percent_eligible_relays
'
)
assert
header
.
minimum_number_eligible_relays
==
'
2
'
assert
header
.
minimum_percent_eligible_relays
==
str
(
MIN_REPORT
)
assert
header
.
number_consensus_relays
==
'
3
'
assert
header
.
number_eligible_relays
==
'
3
'
assert
header
.
percent_eligible_relays
==
'
100
'
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