Changeset 6997754f1e5a1727f26fdd3d1ac6ee4f7fd3a221

Show
Ignore:
Timestamp:
04/26/10 03:39:05 (9 years ago)
Author:
Jason Dixon <jdixon@omniti.com>
git-committer:
Jason Dixon <jdixon@omniti.com> 1272253145 +0000
git-parent:

[e049e1e82b3ac014945cf6c82ad5bdc5bc439b8f]

git-author:
Jason Dixon <jdixon@omniti.com> 1272253145 +0000
Message:

freebsd support

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@331 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Core/Iostat.pm

    r07e5733 r6997754  
    6464 
    6565Kilobytes written per second. 
     66 
     67=item lqueue_txn 
     68 
     69Transaction queue length. 
    6670 
    6771=item wait_txn 
     
    158162            die "Unable to find disk: $disk\n"; 
    159163        } 
     164    } elsif ($osname eq 'freebsd') { 
     165        my $output = run_command("$iostat_path -x $disk"); 
     166        my ($line) = grep(/$disk\s*/, split(/\n/, $output)); 
     167        if ($line =~ /^$disk\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\S+).*/) { 
     168            return { 
     169                'reads_sec' => [$1, 'i'], 
     170                'writes_sec' => [$2, 'i'], 
     171                'kb_read_sec' => [$3, 'i'], 
     172                'kb_write_sec' => [$4, 'i'], 
     173                'lqueue_txn' => [$5, 'i'], 
     174                'rspt_txn' => [$6, 'i'] 
     175            }; 
     176        } else { 
     177            die "Unable to find disk: $disk\n"; 
     178        } 
    160179    } elsif ($osname eq 'openbsd') { 
    161180        my $output = run_command("$iostat_path -D -I $disk");