Java 类hudson.model.AdministrativeMonitor 实例源码

项目:ec2-plugin    文件:ZPoolMonitor.java   
@Override
protected void doRun() {
       ZFSFileSystem fs=null;
       try {
           if(isInsideEC2())
               fs = new LibZFS().getFileSystemByMountPoint(Hudson.getInstance().getRootDir());
       } catch (LinkageError e) {
           // probably not running on OpenSolaris
       }
       if(fs==null) {
           cancel();
           return;
       }
       ZFSPool pool = fs.getPool();
       long a = pool.getAvailableSize();
       long t = pool.getSize();

       // if the disk is 90% filled up and the available space is less than 1GB,
       // notify the user
       ZPoolExpandNotice zen = AdministrativeMonitor.all().get(ZPoolExpandNotice.class);
       zen.activated = t/a>10 && a<1000L*1000*1000;
   }