@@ -169,8 +169,8 @@ sub cl_netstat {
169
169
# 8 16 sdb 2640 380 18329 2860 1751748 13461886 121702720 249041290 78 2654720 249048720
170
170
# 8 1 sda1 35383589 4096190 515794290 173085956 58990656 100542811 1276270912 205189188 0 135658516 378268412
171
171
# EC2 machines get disks with partitions but not whole disks
172
- # TODO: sort out devices to make sure partitions are not double-counted with whole devices
173
- #
172
+ # TODO: sort out devices to make sure partitions are not double-counted with whole devices
173
+ #
174
174
# from Documentation/iostats.txt:
175
175
# Field 1 -- # of reads completed
176
176
# Field 2 -- # of reads merged
@@ -231,18 +231,18 @@ sub diff_cl_netstat {
231
231
$tdiff = $s2 -> {$host }{$iface }{tbytes };
232
232
}
233
233
234
- # 0: read_bytesps, 1: write_bytesps
234
+ # 0: read_bytesps, 1: write_bytesps
235
235
push @host_traffic , int ($rdiff / $seconds ), int ($tdiff / $seconds );
236
- # 2: total_byteps, 3: 0 (using an array here was silly, should be hash)
237
- push @host_traffic , int ($tput / $seconds ), 0;
236
+ # 2: total_byteps, 3: 0 (using an array here was silly, should be hash)
237
+ push @host_traffic , int ($tput / $seconds ), 0;
238
238
}
239
239
}
240
240
241
- # iops
241
+ # iops
242
242
$host_traffic [4] = ($s1 -> {$host }{dsk_rds } - $s2 -> {$host }{dsk_rds }) / $seconds ;
243
243
$host_traffic [5] = ($s1 -> {$host }{dsk_wds } - $s2 -> {$host }{dsk_wds }) / $seconds ;
244
244
245
- # iowait
245
+ # iowait
246
246
$host_traffic [6] = ($s1 -> {$host }{dsk_rwt } - $s2 -> {$host }{dsk_rwt });
247
247
$host_traffic [7] = ($s1 -> {$host }{dsk_wwt } - $s2 -> {$host }{dsk_wwt });
248
248
@@ -274,11 +274,11 @@ sub diff_cl_netstat {
274
274
qw( hostname net_packets net_rx_bytes net_tx_bytes dsk_riops dsk_wiops rwait_ms wwait_ms ) ;
275
275
print CYAN, $header , $/ , ' -' x length ($header ), $/ , RESET;
276
276
277
- # iteration totals
278
- my $host_count = 0;
279
- my ($ivl_net_rx_total , $ivl_net_tx_total ) = (0, 0);
280
- my ($ivl_riops_total , $ivl_wiops_total ) = (0, 0);
281
- my ($ivl_rwait_total , $ivl_wwait_total ) = (0, 0);
277
+ # iteration totals
278
+ my $host_count = 0;
279
+ my ($ivl_net_rx_total , $ivl_net_tx_total ) = (0, 0);
280
+ my ($ivl_riops_total , $ivl_wiops_total ) = (0, 0);
281
+ my ($ivl_rwait_total , $ivl_wwait_total ) = (0, 0);
282
282
283
283
HOST: foreach my $host ( @sorted_host_list ) {
284
284
my $hostname = $host ;
@@ -305,15 +305,15 @@ sub diff_cl_netstat {
305
305
io_c($diff {$host }-> [4]),
306
306
io_c($diff {$host }-> [5]);
307
307
308
- # iowait
309
- my $avg_rwait = $diff {$host }-> [6] / ($diff {$host }-> [4] || 1);
308
+ # iowait
309
+ my $avg_rwait = $diff {$host }-> [6] / ($diff {$host }-> [4] || 1);
310
310
my $avg_wwait = $diff {$host }-> [7] / ($diff {$host }-> [5] || 1);
311
311
printf " %s %8s %s %8s %s%s%s \n " ,
312
312
io_c($avg_rwait ),
313
313
io_c($avg_wwait ),
314
- DKGRAY, $current -> {$host }{comment } || ' ' , RESET;
314
+ DKGRAY, $current -> {$host }{comment } || ' ' , RESET;
315
315
316
- # increment totals
316
+ # increment totals
317
317
$host_count ++;
318
318
$ivl_net_rx_total += $diff {$host }-> [0] + $diff {$host }-> [2];
319
319
$ivl_net_tx_total += $diff {$host }-> [1] + $diff {$host }-> [3];
0 commit comments