Changeset 27861
- Timestamp:
- May 5, 2010, 11:59:12 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool.pl
r27775 r27861 118 118 119 119 my $item; 120 foreach $item (@array1, @array2) { $count{$item}++;}120 foreach $item (@array1, @array2) {$count{$item}++;} 121 121 122 122 foreach $item (keys %count) { … … 350 350 elsif ($stage eq "magic") {$joinTable="magicNodeResult";} 351 351 elsif ($stage eq "magicDS") {$id = "magic_ds_id"; $joinTable="magicDSFile";} 352 elsif ($stage eq "dist") { return countDistFaults($label);}352 elsif ($stage eq "dist") {$joinTable="distComponent";} 353 353 else {return -1;} 354 354 355 355 my $faultCol = $joinTable.".fault"; 356 my $stateCol = $table.".state"; 356 357 357 358 my $query = $db->prepare(<<SQL); … … 361 362 WHERE label LIKE '$label' 362 363 AND $faultCol != 0 363 AND state= 'new'364 AND $stateCol = 'new' 364 365 365 366 SQL … … 369 370 } 370 371 371 ###########################################################################372 #373 # Counts total distribution faults374 #375 ###########################################################################376 sub countDistFaults {377 my ($label) = @_;378 379 my $query = $db->prepare(<<SQL);380 SELECT COUNT(*)381 FROM distRun382 JOIN distComponent USING(dist_id)383 WHERE label LIKE '$label'384 AND distComponent.fault > 0385 AND distRun.state = 'new'386 387 SQL388 389 $query->execute;390 my $count = $query->fetchrow_array();391 392 $query = $db->prepare(<<SQL);393 SELECT COUNT(*)394 FROM distRun395 WHERE label LIKE '$label'396 AND fault > 0397 AND distRun.state = 'new'398 399 SQL400 401 $query->execute;402 403 return $count + $query->fetchrow_array();404 }405
Note:
See TracChangeset
for help on using the changeset viewer.
