Changeset 34576

Show
Ignore:
Timestamp:
07/23/09 15:57:42 (4 years ago)
Author:
nowelium
Message:
 
Location:
platform/mysql/mprofile.php/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • platform/mysql/mprofile.php/trunk/mpdump.php

    r34575 r34576  
    1717    'samples' => 1000, 
    1818)); 
     19 
    1920if($options['help']){ 
    2021    $file = basename(__FILE__); 
     
    4647    $rows = array(); 
    4748    while($row = $stmt->fetch(PDO::FETCH_OBJ)){ 
     49        if((0 !== strcasecmp('Query', $row->Command)) && (0 === strcasecmp('SHOW FULL PROCESSLIST', $row->Info))){ 
     50            continue; 
     51        } 
    4852        $rows[] = $row; 
    4953    } 
  • platform/mysql/mprofile.php/trunk/mpfilter.php

    r34575 r34576  
    44$replacement = array( 
    55    '/\r?\n/' => ' ', 
     6    '/(\"([^\"]+)\")/' => '?', 
     7    '/(\'([^\']+)\')/' => '?', 
     8    '/\s{2,}/' => ' ' 
     9 
    610); 
    711$replacepattern = array_keys($replacement); 
     
    1418    $returnValue = array(); 
    1519    foreach($rows as $row){ 
    16         $info = preg_replace($replacepattern, $replace, $row->Info); 
    17         if(empty($info)){ 
    18             continue; 
    19         } 
    20         $returnValue[] = $info; 
     20        $returnValue[] = preg_replace($replacepattern, $replace, $row->Info); 
    2121    } 
    2222    echo json_encode($returnValue), PHP_EOL; 
  • platform/mysql/mprofile.php/trunk/mpreport.php

    r34575 r34576  
    1111    $line = stream_get_line($stdin, 4096, "\n"); 
    1212    $rows = json_decode($line); 
     13    if(empty($rows)){ 
     14        continue; 
     15    } 
    1316    foreach($rows as $row){ 
     17        if(empty($row)){ 
     18            continue; 
     19        } 
    1420        $hash = md5($row); 
    1521        $sql_hash[$hash] = $row;