IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 2, 2010, 3:09:56 PM (16 years ago)
Author:
rhenders
Message:

Added log plots for timeseries

File:
1 edited

Legend:

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

    r29078 r29114  
    242242###########################################################################
    243243sub createTimeSeriesData {
    244     my ($self, $label, $stage, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
    245 
    246     my $dataFile = "/tmp/czarplot_gnuplot_".$label."_".$stage."_t.dat";
    247     open (GNUDAT, ">$dataFile");
     244    my ($self, $label, $stage, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff, $dataFileLin, $dataFileLog) = @_;
     245
     246    ${$dataFileLin} = "/tmp/czarplot_gnuplot_lin_".$label."_".$stage."_t.dat";
     247    ${$dataFileLog} = "/tmp/czarplot_gnuplot_log_".$label."_".$stage."_t.dat";
     248    open (GNUDATLIN, ">${$dataFileLin}");
     249    open (GNUDATLOG, ">${$dataFileLog}");
    248250
    249251    my $query = $self->{_db}->prepare(<<SQL);
     
    259261SQL
    260262
    261     if (!$query->execute) {return undef;}
     263    if (!$query->execute) {return 0;}
    262264
    263265    my $minProcessed = undef;
     
    265267    ($minProcessed, ${$maxY}, ${$minY}, ${$maxX}, ${$minX}, ${$timeDiff}) = $query->fetchrow_array();
    266268
    267     if (!defined $minProcessed) {return undef;}
     269    if (!defined $minProcessed) {return 0;}
    268270
    269271    $query = $self->{_db}->prepare(<<SQL);
     
    280282    # loop round results
    281283    while (my @row = $query->fetchrow_array()) {
    282 
    283284        my ($timestamp, $pending, $faults, $processed) = @row;
     285
     286        my $processedLog = log($processed + 1);
     287        my $pendingLog = log($pending + 1);
     288        my $faultsLog = log($faults + 1);
     289
    284290    #    print  "'$timestamp' '$pending' '$faults' '$processed'\n";
    285         print GNUDAT "$timestamp $pending $faults $processed\n";
    286     }
    287     close(GNUDAT);
    288 
    289     return $dataFile;
     291        print GNUDATLIN "$timestamp $pending $faults $processed\n";
     292        print GNUDATLOG "$timestamp $pendingLog $faultsLog $processedLog\n";
     293    }
     294
     295    close(GNUDATLIN);
     296    close(GNUDATLOG);
     297
     298    return 1;
    290299}
    291300
Note: See TracChangeset for help on using the changeset viewer.