IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2011, 11:44:07 AM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20111122/ippMonitor
Files:
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippMonitor

  • branches/eam_branches/ipp-20111122/ippMonitor/Makefile.in

    r31816 r32851  
    6060$(DESTWWW)/czartool_getplot.php \
    6161$(DESTWWW)/czartool_exposures.php \
     62$(DESTWWW)/czartool_ipptopsps.php \
    6263$(DESTWWW)/histogram.php \
    6364$(DESTWWW)/show_and_delete_image.php \
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarplot.pl

    r32325 r32851  
    2727my $nebulous = undef;
    2828my $savingToFile = undef;
    29 my $analysis = undef;
    3029my $exposureId = undef;
    3130my $log = undef;
     31my $psps = undef;
    3232
    3333GetOptions (
     
    4545        "nebulous|n" => \$nebulous,
    4646        "rate|r" => \$rate,
    47         "analysis|a" => \$analysis,
    4847        "timeseries|t" => \$timeSeries,
    4948        "verbose|v" => \$verbose,
    5049        "log|g" => \$log,
     50        "psps|u" => \$psps,
    5151        );
    5252
     
    5858    print "* UNKNKOWN: option                          @ARGV\n";
    5959}
    60 if ($analysis && !$stage) {
    61     $quit = 1;
    62     print "* REQUIRED: choose a stage for analsis      -s <chip|cam|warp|etc>      (default=none)\n";}
    6360if (!$histogram) {
    6461    print "* OPTIONAL: plot histogram                  -h                          (default=off)\n";}
     
    7168if (!$rate) {
    7269    print "* OPTIONAL: plot histogram of rate          -r                          (default=off)\n";}
    73 if (!$analysis) {
    74     $analysis = 0;
    75     print "* OPTIONAL: include analysis                -a                          (default=$analysis)\n";}
    7670if (!$log) {
    7771    $log = 0;
     
    9791    print "* OPTIONAL: choose an output location       -o <path>                   (default=none)\n";
    9892}
     93if (!$psps) {
     94    print "* OPTIONAL: plot ippToPsps stages           -u                          (default=off)\n";}
    9995print "*\n*******************************************************************************\n";
    10096
     
    104100
    105101# default values
    106 if (!$rate && !$magicMask && !$nebulous && !$histogram && !$analysis && !$timeSeries) {$timeSeries = 1;}
     102if (!$rate && !$magicMask && !$nebulous && !$histogram && !$timeSeries) {$timeSeries = 1;}
    107103if (!$verbose) {$verbose = 0;}
    108104if (!$save_temps) {$save_temps = 0;}
     
    123119    $plotter = czartool::Plotter->new_display($config, $save_temps);
    124120}
     121
     122if ($psps) {$plotter->setIppToPspsMode();}
    125123
    126124# if a single day has been chosen
     
    177175}
    178176
    179 if($analysis) {
    180 
    181     my $stageMetrics = new czartool::StageMetrics($stage, $label, $begin, $end);
    182     if ($czarDb->runAnalysis($stageMetrics)) {$stageMetrics->printMe();}
    183 }
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarpoll.pl

    r32213 r32851  
    3737
    3838
    39 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
    40 
     39my @stages = (
     40        "burntool",
     41        "chip",
     42        "cam",
     43        "fake",
     44        "warp",
     45        "stack",
     46        "diff",
     47        "magic",
     48        "magicDS",
     49        "dist",
     50        "pub");
     51
     52my @ippToPspsStages = (
     53        "processed",
     54        "loaded_to_datastore",
     55        "loaded_to_ODM",
     56        "merge_worthy",
     57        "deleted_datastore",
     58        "deleted_dxlayer",
     59        "merged",
     60        "deleted_local");
     61
     62my @allStages = (@stages, @ippToPspsStages);
    4163
    4264timePoll($period);
     
    244266    print "* Generating plots\n";
    245267
     268    # get ippToPsps labels
     269    my $ippToPspsLabels = undef;
     270    $czarDb->getCurrentIppToPspsLabels($begin, $end, \$ippToPspsLabels);
     271    $plotter->setIppToPspsMode();
     272   
     273    # create ippToPsps labels
     274    foreach $stage (@ippToPspsStages) {
     275        foreach $row ( @{$ippToPspsLabels} ) {
     276            my ($label) = @{$row};
     277           
     278            chomp($label);
     279            $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1);
     280        }
     281    }
     282
     283    # create plots for each label for all stages for ippToPsps
     284    foreach $row ( @{$ippToPspsLabels} ) {
     285        my ($label) = @{$row};
     286
     287        $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1);
     288    }
     289
     290
    246291    # create plots for each label for each stage
     292    $plotter->setStandardMode();
    247293    foreach $stage (@stages) {
    248294        foreach $row ( @{$rows} ) {
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/CzarDb.pm

    r32735 r32851  
    88use File::Temp;
    99
    10 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub"); # TODO put elsewhere
     10my @stages = (
     11        "burntool",
     12        "chip",
     13        "cam",
     14        "fake",
     15        "warp",
     16        "stack",
     17        "diff",
     18        "magic",
     19        "magicDS",
     20        "dist",
     21        "pub"); # TODO put elsewhere
     22
     23my @ippToPspsStages = (
     24        "processed",
     25        "loaded_to_datastore",
     26        "loaded_to_ODM",
     27        "merge_worthy",
     28        "deleted_datastore",
     29        "deleted_dxlayer",
     30        "merged",
     31        "deleted_local");
     32
     33my @allStages = (@stages, @ippToPspsStages);
    1134
    1235use base 'czartool::MySQLDb';
     
    3356###########################################################################
    3457#
    35 # Gets current_labels table
     58# Gets current ippToPsps labels
     59#
     60###########################################################################
     61sub getCurrentIppToPspsLabels {
     62    my ($self, $begin, $end, $labels) = @_;
     63
     64    my $query = $self->{_db}->prepare(<<SQL);
     65
     66    SELECT DISTINCT label
     67        FROM processed
     68        WHERE timestamp >= '$begin'
     69        AND timestamp <= '$end'
     70SQL
     71
     72    if (!$query->execute) {return 0;}
     73
     74    ${$labels} = $query->fetchall_arrayref();
     75
     76    return 1;
     77}
     78
     79###########################################################################
     80#
     81# Gets current labels from the current_labels table
    3682#
    3783###########################################################################
     
    672718            # times
    673719            $timeSep = $self->diffTimesInSecs($thisTimestamp, $lastTimestamp);
     720            if ($timeSep == 0) {$timeSep = 1;}; # HACK to prevent divide-by-zero
     721
    674722            $middleTime = $self->getMiddleTime($lastTimestamp, $thisTimestamp);
    675723            $formattedMiddleTimestamp = $self->getFormattedDate($middleTime);
     
    681729            # added, and store value to subtract from linear value below. If > 1000
    682730            # processed per hour, then it must be wrong
    683             if (($thisProcessed - $lastProcessed)/(($timeSep/3600)+1) > 1000) {
     731            if (($thisProcessed - $lastProcessed)/($timeSep/3600) > 1000) {
    684732                $positiveJump = $thisProcessed - $lastProcessed;
    685733            }
     
    701749
    702750            # calculate first derivative in units of images per hour
    703             $derivPending = $diffPending/($timeSep/3600 +1);
    704             $derivFaults = $diffFaults/($timeSep/3600 +1);
    705             $derivProcessed = $diffProcessed/($timeSep/3600 +1);
     751            $derivPending = $diffPending/($timeSep/3600);
     752            $derivFaults = $diffFaults/($timeSep/3600);
     753            $derivProcessed = $diffProcessed/($timeSep/3600);
    706754
    707755        }
     
    11071155        my $stage = undef;
    11081156        $totalDeleted = 0;
    1109         foreach $stage (@stages) {
     1157        foreach $stage (@allStages) {
    11101158
    11111159            if (!$self->getLabelsInThisTimePeriod($stage, $fromTime, $toTime, \$labels)) {next;}
     
    12131261
    12141262    my $stage = undef;
    1215     foreach $stage (@stages) {
     1263    foreach $stage (@allStages) {
    12161264
    12171265        $self->optimizeTable($stage);
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Pantasks.pm

    r32102 r32851  
    1010        "addstarlap",
    1111        "cleanup",
     12        "deepstack",
    1213        "detrend",
    1314        "distribution",
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Plotter.pm

    r32093 r32851  
    1010use czartool::Config;
    1111
    12 my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
     12my @allStages = (
     13        "burntool",
     14        "chip",
     15        "cam",
     16        "fake",
     17        "warp",
     18        "stack",
     19        "diff",
     20        "magic",
     21        "magicDS",
     22        "dist",
     23        "pub");
     24
     25my @allIppToPspsStages = (
     26        "processed",
     27        "loaded_to_datastore",
     28        "loaded_to_ODM",
     29        "merge_worthy",
     30        "deleted_datastore",
     31        "deleted_dxlayer",
     32        "merged",
     33        "deleted_local");
     34
    1335
    1436###########################################################################
     
    7597###########################################################################
    7698#
     99# Sets plotter to use standard IPP mode, i.e. chip, cam etc
     100#
     101###########################################################################
     102sub setStandardMode {
     103    my ($self) = @_;
     104
     105    $self->{allStages} = \@allStages;
     106}
     107
     108###########################################################################
     109#
     110# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc
     111#
     112###########################################################################
     113sub setIppToPspsMode {
     114    my ($self) = @_;
     115
     116    $self->{allStages} = \@allIppToPspsStages;
     117}
     118
     119###########################################################################
     120#
    77121# Some initialisation code common to all constructors
    78122#
     
    83127    $self->{_gpc1Db} = $self->{_config}->getGpc1Instance();
    84128    $self->{_czarDb} = $self->{_config}->getCzarDbInstance();
     129    $self->setStandardMode();
    85130}
    86131
     
    140185    my $stages = undef;                 
    141186    if (!$selectedStage) {
    142         $stages = \@allStages;
     187        $stages = \@{$self->{allStages}};
    143188        $selectedStage = 'all_stages';
    144189    }
     
    203248        "set style histogram rowstacked;" .
    204249        "set style fill solid border -1;" .
    205         "set ylabel \"Exposures processed per $interval\";" .
     250        "set ylabel \"Items processed per $interval\";" .
    206251        "set boxwidth 0.75;" .
    207252        "plot ";
    208253
    209254    my $first = 1;
    210     foreach my $stage (@allStages) {
     255    foreach my $stage (@{$self->{allStages}}) {
    211256
    212257
     
    226271###########################################################################
    227272#
    228 # Plots a time series for all stages for this label
     273# Plots a time series for all or one stage for this label
    229274#
    230275###########################################################################
     
    238283    my $stages = undef;                 
    239284
    240     if (!$selectedStage) {$stages = \@allStages;}
     285    if (!$selectedStage) {$stages = \@{$self->{allStages}};}
    241286    else {$stages = ["$selectedStage"]};       
    242287
     
    297342                $timeDiff,
    298343                "",
    299                 "Exposures");
     344                "Items");
    300345    }
    301346
     
    314359                $timeDiff,
    315360                "",
    316                 "Log(Exposures)");
     361                "Log(Items)");
    317362    }
    318363
     
    331376                $timeDiff,
    332377                "",
    333                 "Exposures per hour");
     378                "Items per hour");
    334379}   
    335380}                                               
     
    351396    my $stage = undef;
    352397    my $pendingMinusFaults = undef;
    353     foreach $stage (@allStages) {
     398    foreach $stage (@{$self->{allStages}}) {
    354399
    355400        if (!$self->{_czarDb}->countProcessedPendingAndFaults(
     
    381426        "set style histogram rowstacked;" .
    382427        "set style fill solid border -1;" .
    383         "set ylabel \"Exposures\";" .
     428        "set ylabel \"Items\";" .
    384429        "set boxwidth 0.75;" .
    385430        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .
     
    520565    my $firstIn = 1;
    521566    # loop through stages array so that they are ordered properly (not maintained in hash)
    522     foreach my $stage (@allStages) {
     567    #foreach my $stage (@allStages) {
     568    foreach my $stage (@{$self->{allStages}}) {
    523569
    524570        if(!$gnuplotFiles->{$stage}) {next;}
     
    620666        "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
    621667        "set style fill solid 1.00 border -1;" .
     668        "set key center top;" .
    622669        "set style histogram rowstacked;" .
    623670        "set style data histograms;" .
  • branches/eam_branches/ipp-20111122/ippMonitor/raw/czartool_labels.php

    r32644 r32851  
    2727menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);
    2828
    29 $states=array("full","new","drop","wait");
    30 $stages=array("burntool", "chip","cam","fake","warp","stack","diff","magic","magicDS","dist", "pub");
     29$stages=array(
     30        "burntool",
     31        "chip",
     32        "cam",
     33        "fake",
     34        "warp",
     35        "stack",
     36        "diff",
     37        "magic",
     38        "magicDS",
     39        "dist",
     40        "pub");
     41
    3142$servers=array(
    3243        "addstar",
     
    150161echo "<br>";
    151162echo $table;
    152 #"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     163
    153164createTableTitle("Status and links", 3);
    154165echo "<tr>\n";
     
    180191         $pubLabels,
    181192         $stages,
    182          $states,
    183193         "new",
    184194         $selectedLabel,
     
    349359        $pubLabels,
    350360        $stages,
    351         $states,
    352361        $selectedState,
    353362        $selectedLabel, $selectedStage, $plotType) {
  • branches/eam_branches/ipp-20111122/ippMonitor/raw/ipp.imfiles.dat

    r29481 r32851  
    2121menutop   | menutop      | link    | simple plot - chip (to remove?) | simplePlot.php
    2222menutop   | menutop      | link    | simple plot - cam (to remove?) | simplePlotcam.php
    23 menutop   | menutop      | link    | czartool                     | czartool_labels.php
     23menutop   | menutop      | link    | czartool - standard          | czartool_labels.php
     24menutop   | menutop      | link    | czartool - ipptopsps         | czartool_ipptopsps.php
    2425menutop   | menutop      | link    | mask stats                   | maskStats.php
    2526
Note: See TracChangeset for help on using the changeset viewer.