IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30913


Ignore:
Timestamp:
Mar 16, 2011, 9:03:53 AM (15 years ago)
Author:
rhenders
Message:

Quick fix for jumps in time-series plots when new lable is added. Not elegant.

File:
1 edited

Legend:

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

    r30397 r30913  
    629629    my ($derivProcessed, $derivPending, $derivFaults);
    630630    my $timestamp = undef;
    631    
     631    my $positiveJump = 0;
     632
    632633    $linearProcessed = 0;
    633634    my $someData = 0;
     
    635636        my ($thisTimestamp, $thisPending, $thisFaults, $thisProcessed) = @row;
    636637
    637         # get linear values
    638         if ($showCleanup) {
    639        
    640             $linearProcessed = $thisProcessed - $minProcessed;
    641         }
    642         elsif($lastProcessed != -1 && $thisProcessed > $lastProcessed) {
    643            
    644             $linearProcessed = $linearProcessed + ($thisProcessed - $lastProcessed);
    645         }
    646         $linearPending = $thisPending;
    647         $linearFaults = $thisFaults;
    648638
    649639        # get first derivative values
     
    660650        #    $derivPending = abs($thisPending - $lastPending)/$timeDiff;   
    661651        #    $derivFaults = abs($thisFaults - $lastFaults)/$timeDiff;   
     652
     653            # look for large positive jumps in processed, most likely a label added, and store value to subtract from linear value below
     654            if ($derivProcessed > 0.3) {
     655
     656                $positiveJump = $thisProcessed - $lastProcessed;
     657                #print "$derivProcessed at $thisTimestamp   $positiveJump\n";
     658        }
     659            else {
     660            $positiveJump = 0;
     661            }
    662662        }
    663663        else {
     
    667667            $derivFaults = 0;
    668668        }
     669
     670        # get linear values
     671        if ($showCleanup) {
     672       
     673            $linearProcessed = $thisProcessed - $minProcessed;
     674        }
     675        elsif($lastProcessed != -1 && $thisProcessed > $lastProcessed) {
     676           
     677            $linearProcessed = $linearProcessed + ($thisProcessed - $lastProcessed) - $positiveJump;
     678        }
     679        $linearPending = $thisPending;
     680        $linearFaults = $thisFaults;
    669681
    670682        # get log values
Note: See TracChangeset for help on using the changeset viewer.