Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
16c9b3f4
Commit
16c9b3f4
authored
Jan 17, 2024
by
Antoine Kaufmann
Committed by
Hejing Li
Feb 01, 2024
Browse files
experiments: switch to social workload in timesync experiment
parent
319be18c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
experiments/pyexps/timesync.py
experiments/pyexps/timesync.py
+11
-8
No files found.
experiments/pyexps/timesync.py
View file @
16c9b3f4
...
@@ -133,8 +133,9 @@ class CockroachClient(ChronyClient):
...
@@ -133,8 +133,9 @@ class CockroachClient(ChronyClient):
super
().
__init__
()
super
().
__init__
()
self
.
init
=
False
self
.
init
=
False
self
.
servers
=
[]
self
.
servers
=
[]
self
.
workload
=
'kv'
self
.
workload
=
'social'
self
.
workload_args
=
'--read-percent=50 --sequential'
self
.
workload_init_args
=
'--splits=3'
self
.
workload_args
=
'--splits=3 --concurrency 100'
def
run_cmds
(
self
,
node
):
def
run_cmds
(
self
,
node
):
server_ports
=
[
f
'
{
ip
}
:26257'
for
ip
in
self
.
servers
]
server_ports
=
[
f
'
{
ip
}
:26257'
for
ip
in
self
.
servers
]
...
@@ -156,13 +157,15 @@ class CockroachClient(ChronyClient):
...
@@ -156,13 +157,15 @@ class CockroachClient(ChronyClient):
cmds
.
append
(
'sleep 1'
)
cmds
.
append
(
'sleep 1'
)
cmds
.
append
(
cmds
.
append
(
f
'/usr/local/bin/cockroach workload init
{
self
.
workload
}
'
f
'/usr/local/bin/cockroach workload init
{
self
.
workload
}
'
f
'"
{
connstr
}
"'
)
f
'
{
self
.
workload_init_args
}
"
{
connstr
}
"'
)
cmds
.
append
(
'sleep 0.5'
)
cmds
.
append
(
'sleep 0.5'
)
else
:
else
:
cmds
.
append
(
'sleep
3
'
)
cmds
.
append
(
'sleep
4
'
)
cmds
.
append
(
cmds
.
append
(
f
'/usr/local/bin/cockroach workload run
{
self
.
workload
}
'
f
'/usr/local/bin/cockroach workload run
{
self
.
workload
}
'
f
'--duration=10s
{
self
.
workload_args
}
"
{
connstr
}
"'
)
f
'--duration=10s
{
self
.
workload_args
}
"
{
connstr
}
"'
)
http
=
f
'https://
{
self
.
servers
[
i
]
}
:8080/_status/vars'
cmds
.
append
(
f
'curl -k
{
http
}
'
)
return
super
().
run_cmds
(
node
)
+
cmds
return
super
().
run_cmds
(
node
)
+
cmds
kinds_of_host
=
[
'qemu'
,
'qemu_sync'
]
kinds_of_host
=
[
'qemu'
,
'qemu_sync'
]
...
@@ -276,9 +279,9 @@ for h in kinds_of_host:
...
@@ -276,9 +279,9 @@ for h in kinds_of_host:
clients
[
0
].
wait
=
True
clients
[
0
].
wait
=
True
clients
[
0
].
node_config
.
app
.
init
=
True
clients
[
0
].
node_config
.
app
.
init
=
True
for
hh
in
servers
+
clients
:
#
for hh in servers + clients:
hh
.
sync_drift
=
int
(
random
.
gauss
(
mu
=
1000.0
,
sigma
=
10
))
#
hh.sync_drift = int(random.gauss(mu=1000.0, sigma=10))
hh
.
sync_offset
=
int
(
random
.
uniform
(
0.0
,
1000000.0
))
#
hh.sync_offset = int(random.uniform(0.0, 1000000.0))
print
(
f
'host
{
hh
.
name
}
: drift=
{
hh
.
sync_drift
}
offset=
{
hh
.
sync_offset
}
'
)
#
print(f'host {hh.name}: drift={hh.sync_drift} offset={hh.sync_offset}')
experiments
.
append
(
e
)
experiments
.
append
(
e
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment