-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtester.ps1
52 lines (43 loc) · 1.83 KB
/
tester.ps1
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$TESTS_NUM = 3
$TRACE_LIMIT = 4090
function clear_env() {
Invoke-Expression "rm trace*"
}
function clear_reports() {
Invoke-Expression "rm *.report"
}
function runTests ($tag, $base, $arguments) {
# $highest = -1;
# $lowest = 999999;
$totalMillisecondsSum = 0
for ($i = 0; $i -lt $TESTS_NUM; $i++) {
clear_env
Write-Host "[($i) $tag]"
$report_tag = "$(Get-Date -Format FileDateTime)" + ".report"
$time_span = Measure-Command { Invoke-Expression "$base -trace_limit $TRACE_LIMIT -tag $report_tag $arguments" | Out-Default }
$totalMilliseconds = $time_span.TotalMilliseconds
$totalMillisecondsSum += $totalMilliseconds
# if ($totalMilliseconds -gt $highest) { $highest = $totalMilliseconds }
# if ($totalMilliseconds -lt $lowest) { $lowest = $totalMilliseconds }
}
# $totalMillisecondsSum -= ($highest + $lowest)
# $avg_time = $totalMillisecondsSum / ($TESTS_NUM - 2)
$avg_time = ($totalMillisecondsSum / $TESTS_NUM)
Write-Host "{$tag Average time: $avg_time}"
}
# $PROG = "C:\Users\tulim\Downloads\fciv.exe -md5 -sha1 C:\Users\tulim\Downloads\ubuntu-17.10-desktop-amd64.iso"
# $PROG = "C:\Users\tulim\Downloads\fciv.vmp.exe C:\Users\tulim\Downloads\ubuntu-17.10-desktop-amd64.iso"
# $PROG = "driverquery /V"
# $PROG = "systeminfo"
$BASE = "C:\Pin35\pin.exe -t C:\Pin35\icount32.dll -trace_limit $TRACE_LIMIT"
clear_reports
Write-Host "--- Beginning Tests for --- $PROG"
$XS_THREAD_BUF = 10
$SM_THREAD_BUF = 30
$MD_THREAD_BUF = 50
$LG_THREAD_BUF = 100
$XL_THREAD_BUF = 200
# runTests "Original" $PROG "--"
# runTests "Buffered ($SM_THREAD_BUF Mb)" $BASE "-buffered -thread_buffer_size $SM_THREAD_BUF -- $PROG"
# runTests "Thread flushed ($SM_THREAD_BUF Mb)" $BASE "-thread_flushed -thread_buffer_size $SM_THREAD_BUF -- $PROG"
runTests "Flushed" $BASE "-- $PROG"