@@ -42,7 +42,7 @@ $qoswindow = 5
42
42
43
43
# clean result file and set column headers
44
44
del - Force $outfile - ErrorAction SilentlyContinue
45
- ' WriteRatio' , ' QOS' , ' AVCPU' , ' IOPS' -join " `t " > $outfile
45
+ ' WriteRatio' , ' QOS' , ' AVCPU' , ' IOPS' , ' AVRLat ' , ' AVWLat ' -join " `t " > $outfile
46
46
47
47
# make qos policy and reset
48
48
Get-StorageQosPolicy - Name SweepQos - ErrorAction SilentlyContinue | Remove-StorageQosPolicy - Confirm:$false
@@ -73,6 +73,13 @@ function get-pc(
73
73
($pc [$t0 .. $t1 ].CounterSamples.CookedValue | measure - Average).Average
74
74
}
75
75
76
+ $pc = @ (' \Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time' ,
77
+ ' \Processor Information(_Total)\% Processor Performance' ,
78
+ ' \Cluster CSVFS(_Total)\reads/sec' ,
79
+ ' \Cluster CSVFS(_Total)\avg. sec/read' ,
80
+ ' \Cluster CSVFS(_Total)\writes/sec' ,
81
+ ' \Cluster CSVFS(_Total)\avg. sec/write' )
82
+
76
83
# limit the number of attempts per sweep (mix) to 4 per targeted cpu util
77
84
$sweeplimit = ($cputargets.count * 4 )
78
85
@@ -102,10 +109,11 @@ foreach ($w in 0,10,30) {
102
109
write-host - fore Cyan Starting loop with QoS target $qos
103
110
104
111
$curaddspec = " $ ( $addspec ) w$ ( $w ) qos$qos "
105
- start-sweep.ps1 - addspec $curaddspec - b 4 - o 32 - t 1 - w $w - p r - d 60 - warm 15 - cool 15 - pc ' \Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time ' , ' \Processor Information(_Total)\% Processor Performance '
112
+ start-sweep.ps1 - addspec $curaddspec - b 4 - o 32 - t 1 - w $w - p r - d 60 - warm 15 - cool 15 - pc $pc
106
113
107
114
# HACKHACK bounce collect
108
- Get-ClusterSharedVolume | ? { $_.SharedVolumeInfo.FriendlyVolumeName -match ' collect' } | Move-ClusterSharedVolume
115
+ Get-ClusterSharedVolume | ? { $_.SharedVolumeInfo.FriendlyVolumeName -match ' collect' } | Move-ClusterSharedVolume
116
+ sleep 1
109
117
110
118
# get average IOPS at DISKSPD
111
119
@@ -123,10 +131,37 @@ foreach ($w in 0,10,30) {
123
131
$trt = get-pc $_ $center ' \Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time'
124
132
$ppc = get-pc $_ $center ' \Processor Information(_Total)\% Processor Performance'
125
133
$trt * $ppc / 100
134
+
135
+
126
136
} | measure - Average).Average
127
137
138
+ # get average latency for central 60 seconds, all nodes
139
+ # note we must aggregate the product of av latency and iops per node to get total
140
+ # latency, and then divide by total iops to get whole-cluster average.
141
+
142
+ $csvrtotal = 0
143
+ $csvwtotal = 0
144
+
145
+ ($avrlat , $avwlat ) = $ (dir $result \* .blg | % {
146
+
147
+ $csvrlat = get-pc $_ $center ' \Cluster CSVFS(_Total)\avg. sec/read'
148
+ $csvwlat = get-pc $_ $center ' \Cluster CSVFS(_Total)\avg. sec/write'
149
+ $csvr = get-pc $_ $center ' \Cluster CSVFS(_Total)\reads/sec'
150
+ $csvw = get-pc $_ $center ' \Cluster CSVFS(_Total)\writes/sec'
151
+
152
+ $csvrtotal += $csvr
153
+
154
+ $csvwtotal += $csvw
155
+
156
+ [pscustomobject ] @ { ' avrtime' = $csvrlat * $csvr ; ' avwtime' = $csvwlat * $csvw }
157
+
158
+ } | measure - Sum - Property avrtime, avwtime).Sum
159
+
160
+ $avrlat /= $csvrtotal
161
+ $avwlat /= $csvwtotal
162
+
128
163
# capture results
129
- $w , $qos , $avcpu , $iops -join " `t " >> $outfile
164
+ $w , $qos , $avcpu , $iops , $avrlat , $avwlat -join " `t " >> $outfile
130
165
131
166
# archive results
132
167
compress-archive - Path $ (dir $result \* - Exclude * .zip) - DestinationPath $result \$curaddspec.zip
@@ -135,7 +170,7 @@ foreach ($w in 0,10,30) {
135
170
136
171
# stop within targetwindow% of cpu (+/- % of target)
137
172
if (is- within $avcpu $cputarget $cputargetwindow ) {
138
- write-host - ForegroundColor Green Stopping in target window at $avcpu with QoS at $qos
173
+ write-host - ForegroundColor Green " Stopping in target window at $ ( ' {0:N2} ' -f $ avcpu) with QoS $qos "
139
174
break
140
175
}
141
176
@@ -154,17 +189,17 @@ foreach ($w in 0,10,30) {
154
189
}
155
190
156
191
if ($inwindow ) {
157
- write-host - ForegroundColor Yellow Stopping in window of prior measurement at $avcpu with QoS at $qos
192
+ write-host - ForegroundColor Yellow " Stopping in window of prior measurement at $ ( ' {0:N2} ' -f $ avcpu) with QoS $qos "
158
193
break
159
194
}
160
195
161
196
# stop if next qos target is less than initial
162
197
if ($nextqos -lt $qosinitial ) {
163
- write-host - ForegroundColor Red Stopping with underflow targeting $nextqos less than initial $qosinitial
198
+ write-host - ForegroundColor Red " Stopping with underflow targeting $nextqos less than initial $qosinitial "
164
199
break
165
200
}
166
201
167
- write-host - ForegroundColor Cyan Next loop targeting $nextqos
202
+ write-host - ForegroundColor Cyan " Loop acheived $ ( ' {0:N2} ' -f $avcpu ) @ QoS $qos v. target $cputarget - next loop targeting QoS $nextqos "
168
203
169
204
# record this datapoint as measured, move along to the next
170
205
$h [$qos ] = 1
0 commit comments