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
212ba3fd
Commit
212ba3fd
authored
7 years ago
by
Matt Traudt
Committed by
Matt Traudt
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make the conversion to KiB in a better place
parent
8e650d83
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbws/core/generate.py
+3
-2
3 additions, 2 deletions
sbws/core/generate.py
with
3 additions
and
2 deletions
sbws/core/generate.py
+
3
−
2
View file @
212ba3fd
...
...
@@ -14,8 +14,9 @@ log = logging.getLogger(__name__)
class
V3BWLine
:
def
__init__
(
self
,
fp
,
bw
,
nick
,
rtts
,
last_time
):
self
.
fp
=
fp
self
.
bw
=
max
(
round
(
bw
),
1
)
self
.
nick
=
nick
# convert to KiB and make sure the answer is at least 1
self
.
bw
=
max
(
round
(
bw
/
1024
),
1
)
# convert to ms
rtts
=
[
round
(
r
*
1000
)
for
r
in
rtts
]
self
.
rtt
=
round
(
median
(
rtts
))
...
...
@@ -34,7 +35,7 @@ def result_data_to_v3bw_line(data, fingerprint):
assert
isinstance
(
res
,
ResultSuccess
)
results
=
data
[
fingerprint
]
nick
=
results
[
0
].
nickname
speeds
=
[
dl
[
'
amount
'
]
/
dl
[
'
duration
'
]
/
1024
speeds
=
[
dl
[
'
amount
'
]
/
dl
[
'
duration
'
]
for
r
in
results
for
dl
in
r
.
downloads
]
speed
=
median
(
speeds
)
rtts
=
[
rtt
for
r
in
results
for
rtt
in
r
.
rtts
]
...
...
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