IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29865


Ignore:
Timestamp:
Nov 26, 2010, 3:25:30 PM (15 years ago)
Author:
rhenders
Message:

removed redundant 'log' option for rate plots; some improved error checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/CzarDb.pm

    r29753 r29865  
    719719SQL
    720720
    721     $query->execute;
     721    if (!$query->execute) {return 0;}
     722
    722723    (${$pending}, ${$faults}) = $query->fetchrow_array();   
    723724
    724725    ${$processed} = $self->countProcessed($label, $stage, $fromTime, $toTime);
     726
     727    if (!${$pending}) {${$pending} = 0;}
     728    if (!${$faults}) {${$faults} = 0;}
     729    if (!${$processed}) {${$processed} = 0;}
    725730
    726731    return 1;
     
    822827SQL
    823828
    824 
    825829    if (!$query->execute) {return undef;}
    826830
    827831    (${$maxY}, ${$minY}, ${$maxX}, ${$minX}, ${$timeDiff}) = $query->fetchrow_array();
    828832
     833
     834    if (!${$maxY} || !${$minY} || !${$maxX} || !${$minX} || !${$timeDiff}) {return 0;}
    829835
    830836    $query = $self->{_db}->prepare(<<SQL);
     
    846852
    847853    close(GNUDAT);
    848 }
    849 
    850 ###########################################################################
    851 #
    852 # TODO implement isLog
     854
     855    return 1;
     856}
     857
     858###########################################################################
     859#
     860# Creates data for processing rate plots
    853861#
    854862###########################################################################
    855863sub createProcessingRateData {
    856     my ($self, $stage, $label, $begin, $end, $interval, $dataFile, $isLog) = @_;
     864    my ($self, $stage, $label, $begin, $end, $interval, $dataFile) = @_;
    857865
    858866    my $startTime = $begin;
     
    865873
    866874    my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_gnuplot_".$label."_".$stage."_r.XXXXX", DIR => '/tmp', SUFFIX => 'dat');
    867     $tmpFile->unlink_on_destroy( 0 );
     875    $tmpFile->unlink_on_destroy(0);
    868876    ${$dataFile} = $tmpFile->filename;
    869877
     
    873881    while(1) {
    874882
    875 
    876         #print "NNN $startTime, $end\n";
    877883        if (!$self->isBefore($startTime, $end)) {last;}
    878884        $endTime = $self->addInterval($startTime, $interval);
    879         $self->countProcessedPendingAndFaults($label, $stage, $startTime, $endTime, \$processed, \$pending, \$faults);
     885        if (!$self->countProcessedPendingAndFaults($label, $stage, $startTime, $endTime, \$processed, \$pending, \$faults)) {}
    880886        $timestamp = $self->getFormattedDate($endTime);
     887        if (!$processed) {$processed = 0;}
    881888        print GNUDAT "$timestamp $processed 0 0\n";
    882889
     
    887894
    888895    close(GNUDAT) or print "* Problem closing gnuplot data file for rate plot for '$label' '$stage'\n";
    889 
    890     #return $someData;
    891896}
    892897
Note: See TracChangeset for help on using the changeset viewer.