Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:57:22

0001 #!/usr/bin/env perl
0002 
0003 $iov = 1;
0004 $day = 1;
0005 $month = 1;   
0006 
0007 srand ($time ^ $$ ^ unpack "%L*", 'ps axww | gzip');
0008 
0009 print "VARIABLE IOV_ID NUMBER;\nBEGIN\n";
0010 
0011 %summary;
0012 
0013 $summary{'A'} = '';
0014 $summary{'B'} = '';
0015 $summary{'C'} = '';
0016 
0017 while ($iov < 100) {
0018     $i = int(rand(6))+ 1;
0019     $x = rand();
0020     if ($day > 28) {
0021     $month++;
0022     $day = 1;
0023     }
0024     $sql = "SELECT TEST_IOV_SQ.NextVal INTO :IOV_ID FROM DUAL;\n";
0025     print $sql;
0026     $sql = sprintf("INSERT INTO TEST_IOV VALUES(:iov_id, %d, 1, " .
0027            "TO_DATE(\'%02d-%02d-2010 00:00:00\', \'DD-MM-YYYY HH24:MI:SS\'), " .
0028            "TO_DATE(\'31-12-9999 23:59:59\', \'DD-MM-YYYY HH24:MI:SS\')) " .
0029            ";", 
0030            $i, $day, $month);
0031     print $sql . "\n";
0032     $sql = "";
0033     if ($i == 1) {
0034     $sql .= "INSERT INTO TEST_A VALUES (:iov_id, $x);\n";
0035     $summary{'A'} .= sprintf("%02d%02d\n", $day, $month);
0036     } elsif ($i == 2) {
0037     $sql .= "INSERT INTO TEST_B VALUES (:iov_id, $x);\n";
0038     $summary{'B'} .= sprintf("%02d%02d\n", $day, $month);
0039     } elsif ($i == 3) {
0040     $sql .= "INSERT INTO TEST_A VALUES (:iov_id, $x);\n";
0041     $sql .= "INSERT INTO TEST_B VALUES (:iov_id, $x);\n";
0042     $summary{'A'} .= sprintf("%02d%02d\n", $day, $month);
0043     $summary{'B'} .= sprintf("%02d%02d\n", $day, $month);
0044     } elsif ($i == 4) {
0045     $sql .= "INSERT INTO TEST_C VALUES (:iov_id, $x);\n";
0046     $summary{'C'} .= sprintf("%02d%02d\n", $day, $month);
0047     } elsif ($i == 5) {
0048     $sql .= "INSERT INTO TEST_A VALUES (:iov_id, $x);\n";
0049     $sql .= "INSERT INTO TEST_C VALUES (:iov_id, $x);\n";
0050     $summary{'A'} .= sprintf("%02d%02d\n", $day, $month);
0051     $summary{'C'} .= sprintf("%02d%02d\n", $day, $month);
0052     } elsif ($i == 6) {
0053     $sql .= "INSERT INTO TEST_B VALUES (:iov_id, $x);\n";
0054     $sql .= "INSERT INTO TEST_C VALUES (:iov_id, $x);\n";
0055     $summary{'B'} .= sprintf("%02d%02d\n", $day, $month);
0056     $summary{'C'} .= sprintf("%02d%02d\n", $day, $month);
0057     } else {
0058     $sql .= "INSERT INTO TEST_A VALUES (:iov_id, $x);\n";
0059     $sql .= "INSERT INTO TEST_B VALUES (:iov_id, $x);\n";
0060     $sql .= "INSERT INTO TEST_C VALUES (:iov_id, $x);\n";
0061     $summary{'A'} .= sprintf("%02d%02d\n", $day, $month);
0062     $summary{'B'} .= sprintf("%02d%02d\n", $day, $month);
0063     $summary{'C'} .= sprintf("%02d%02d\n", $day, $month);
0064     }
0065     print $sql . "COMMIT;\n";
0066     $iov++;
0067     $day++;
0068 }
0069 print "END;\n/\n";
0070 
0071 open OUT, ">report.txt";
0072 print OUT "A was measured on\n";
0073 print OUT $summary{'A'};
0074 print OUT "\nB was measured on\n";
0075 print OUT $summary{'B'};
0076 print OUT "\nC was measured on\n";
0077 print OUT $summary{'C'};
0078 close OUT;