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
ab52e2c8
Commit
ab52e2c8
authored
6 years ago
by
juga
Committed by
Matt Traudt
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace unix timestamp to ISO in generate bw lines
parent
fc76b4d9
No related branches found
Branches containing commit
No related tags found
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
+5
-3
5 additions, 3 deletions
sbws/core/generate.py
with
5 additions
and
3 deletions
sbws/core/generate.py
+
5
−
3
View file @
ab52e2c8
from
datetime
import
datetime
from
sbws.globals
import
(
fail_hard
,
is_initted
)
from
sbws.lib.v3bwfile
import
V3BwHeader
from
sbws.lib.resultdump
import
ResultSuccess
from
sbws.lib.resultdump
import
load_recent_results_in_datadir
from
sbws.util.filelock
import
FileLock
from
sbws.util.timestamp
import
unixts_to_isodt_str
,
unixts_to_str
from
argparse
import
ArgumentDefaultsHelpFormatter
from
statistics
import
median
import
os
...
...
@@ -13,8 +12,11 @@ import logging
log
=
logging
.
getLogger
(
__name__
)
# FIXME: move this to v3bwfile?
class
V3BWLine
:
# TODO: docstrings
def
__init__
(
self
,
fp
,
bw
,
nick
,
rtts
,
last_time
):
# TODO: asserts checking arg types
self
.
fp
=
fp
self
.
nick
=
nick
# convert to KiB and make sure the answer is at least 1
...
...
@@ -22,7 +24,7 @@ class V3BWLine:
# convert to ms
rtts
=
[
round
(
r
*
1000
)
for
r
in
rtts
]
self
.
rtt
=
round
(
median
(
rtts
))
self
.
time
=
last_time
self
.
time
=
unixts_to_isodt_str
(
last_time
)
def
__str__
(
self
):
frmt
=
'
node_id=${fp} bw={sp} nick={n} rtt={rtt} time={t}
'
...
...
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