Changeset 19796
- Timestamp:
- Oct 1, 2008, 10:42:31 AM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Build.PL
r19791 r19796 19 19 'File::Path' => '1.08', 20 20 'File::Spec' => 0, 21 'Filesys::Df' => '0.92', 21 22 'File::Spec::Functions' => 0, 22 23 'File::Temp' => 0, … … 25 26 'Params::Validate' => '0.73', 26 27 'SOAP::Lite' => '0.69', 27 'Sys::Statistics::Linux::DiskUsage' => '0.02',28 28 'URI' => '1.30', 29 29 }, -
trunk/Nebulous-Server/Changes
r19792 r19796 10 10 - fix getmountedvol() stored proc to not add volumes to the mountedvol 11 11 table that are not available 12 - dump Sys::Statistics::Linux::DiskUsage for Filesys::Df in nebdiskd as 13 it's behind the scenes usage of `df` instead of statfs() was causing lags 14 on hung NFS mounts 12 15 13 16 0.15 Thu Sep 11 13:00:59 HST 2008 -
trunk/Nebulous-Server/bin/nebdiskd
r19791 r19796 3 3 # Copyright (C) 2007 Joshua Hoblitt 4 4 # 5 # $Id: nebdiskd,v 1. 7 2008-10-01 00:30:53jhoblitt Exp $5 # $Id: nebdiskd,v 1.8 2008-10-01 20:42:31 jhoblitt Exp $ 6 6 7 7 use strict; … … 15 15 use File::Mountpoint qw( is_mountpoint ); 16 16 use File::Spec; 17 use Filesys::Df; 17 18 use Nebulous::Server::SQL; 18 19 use Net::Server::Daemonize qw( daemonize unlink_pid_file ); 19 use Sys::Statistics::Linux::DiskUsage;20 20 21 21 use Getopt::Long qw( GetOptions :config auto_help auto_version ); … … 95 95 my $poll_interval = $p{poll_interval} || 60; 96 96 my $debug = $p{debug} || 0; 97 98 my $lxs = Sys::Statistics::Linux::DiskUsage->new;99 97 100 98 while (1) { … … 137 135 # this has to be done AFTER we determine what the valid mountpoints 138 136 # are incase is_mountpoint() invokes the automounter 139 my $stats = $lxs->get;140 $stats = fix_disk_stats($stats);141 142 137 foreach my $mnt (@valid_mounts) { 143 my $dev_info = $stats->{$mnt};138 my $dev_info = df($mnt, 1024); 144 139 unless (defined $dev_info) { 145 print "can't find device info for $mnt\n" 146 if $debug; 140 print "can't find device info for $mnt\n" if $debug; 147 141 next; 148 142 } 149 $query->execute( @$dev_info{qw( mountpoint total usage)});150 print "adding $ dev_info->{mountpoint}to db\n" if $debug;143 $query->execute($mnt, @$dev_info{qw( blocks used )}); 144 print "adding $mnt to db\n" if $debug; 151 145 } 152 146
Note:
See TracChangeset
for help on using the changeset viewer.
