-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_servers.ps1
More file actions
26 lines (18 loc) · 985 Bytes
/
start_servers.ps1
File metadata and controls
26 lines (18 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$cur_dir = $PSScriptRoot
$start_cmds = @()
$arguments = @( "--title", "Main", "-d", """$cur_dir""", ";")
if ($null -eq $exe)
{
Write-Error "You shouldn't use this script directly, use one of the `start_servers_{debug|release}_xxx.ps1` scripts"
exit
}
for($i=0; $i -lt $num_servers; $i++) {
$cmd = "$exe --num_servers $num_servers -t $threshold --num_clients $num_clients --num_channels $num_channels --timeout $timeoutMs --phase_length $phaseLength server --id $i --heartbeat_interval $heartbeatInterval --election_range $electionRange"
$start_cmds += "new-tab --title ""Server $i"" -d ""$cur_dir"" $cmd"
}
for($i=0; $i -lt $num_clients; $i++) {
$cmd = "$exe --num_servers $num_servers -t $threshold --num_clients $num_clients --num_channels $num_channels --timeout $timeoutMs --phase_length $phaseLength client -i $i "
$start_cmds += "new-tab --title ""Client $i"" -d ""$cur_dir"" $cmd"
}
$arguments += $start_cmds -join ';'
Start-Process wt $arguments