'ASC', ); protected $_display_filters = array( 'DATE_TIME'=>array( array('ORM_TSM::date',array(':value','d-M H:i')), ), ); private $_msgno_ba_objects = array( 4952=>array('msg'=>'ANE4952I Total number of objects inspected:\s+([0-9,]+).*','id'=>'OBJECT_TOTAL'), 4953=>array('msg'=>'','id'=>''), 4954=>array('msg'=>'ANE4954I Total number of objects backed up:\s+([0-9,]+).*','id'=>'OBJECT_BACKUP'), 4957=>array('msg'=>'ANE4957I Total number of objects deleted:\s+([0-9,]+).*','id'=>'OBJECT_DELETED'), 4958=>array('msg'=>'ANE4958I Total number of objects updated:\s+([0-9,]+).*','id'=>'OBJECT_UDPATE'), 4959=>array('msg'=>'ANE4959I Total number of objects failed:\s+([0-9,]+).*','id'=>'OBJECT_FAILED'), 4960=>array('msg'=>'ANE4960I Total number of objects rebound:\s+([0-9,]+).*','id'=>'OBJECT_REBOUND'), 4970=>array('msg'=>'ANE4970I Total number of objects expired:\s+([0-9,]+).*','id'=>'OBJECT_EXPIRED'), 4982=>array('msg'=>'ANE4982I Total objects deduplicated:\s+([0-9,]+).*','id'=>'OJBECT_DEDUPED'), ); private $_msgno_ba_bytes = array( 4961=>array('msg'=>'ANE4961I Total number of bytes transferred:\s+([0-9,\.]+) ([KMG]B).*','id'=>'BYTES_TRANSFER'), 4977=>array('msg'=>'ANE4977I Total number of bytes inspected:\s+([0-9,\.]+) ([KMG]B).*','id'=>'BYTES_INSPECT'), 4975=>array('msg'=>'ANE4975I Total number of bytes processed:\s+([0-9,\.]+) ([KMG]B).*','id'=>'BYTES_PROCESS'), 4984=>array('msg'=>'ANE4984I Total bytes before deduplication:\s+([0-9,\.]+) ([KMG]B).*','id'=>'BYTES_DEDUPE_BEFORE'), 4198=>array('msg'=>'','id'=>''), ); private $_msgno_ba_transfer = array( 4963=>array('msg'=>'ANE4963I Data transfer time:\s+([0-9,\.]+).*','id'=>'TRANSFER_SEC'), 4966=>array('msg'=>'ANE4966I Network data transfer rate:\s+([0-9,\.]+).*','id'=>'TRANSFER_RATE'), 4967=>array('msg'=>'ANE4967I Aggregate data transfer rate:\s+([0-9,\.]+).*','id'=>'TRANSFER_AGGR'), 4964=>array('msg'=>'ANE4964I Elapsed processing time:\s+([0-9:]+).*','id'=>'PROCESS_TIME'), ); private $_msgno_ba_reduction = array( 4968=>array('msg'=>'ANE4968I Objects compressed by:\s+([0-9,\.]+).*','id'=>'COMPRESS'), 4981=>array('msg'=>'ANE4981I Deduplication reduction:\s+([0-9,\.]+).*','id'=>'DEDUPE'), 4976=>array('msg'=>'ANE4976I Total data reduction ratio:\s+([0-9,\.]+).*','id'=>'REDUCTION'), ); private function _bamsgs() { return $this->_msgno_ba_objects+$this->_msgno_ba_bytes+$this->_msgno_ba_transfer+$this->_msgno_ba_reduction; } /** * Return the timestamp of the record in the ACTLOG */ public function FirstRec() { return DB::query(Database::SELECT,'SELECT min(DATE_TIME) as DATE_TIME from ACTLOG')->cached(86400)->execute()->get('DATE_TIME'); } /** * Where class to exclude NODE backup messages */ public function ExcludeBA() { return $this->where('MSGNO','NOT IN',array_keys($this->_bamsgs())); } /** * Extract data from our BA Client messages */ public function msgtrim() { $x = $this->_bamsgs(); if (! array_key_exists($this->MSGNO,$x)) return array(); // @todo Shouldnt need this if (empty($x[$this->MSGNO]['id'])) throw new Kohana_Exception('Message has no ID :id [:msg]',array(':id'=>$this->MSGNO,':msg'=>$this->MESSAGE)); $y = preg_replace('/'.$x[$this->MSGNO]['msg'].'/',"$1$2",$this->MESSAGE); $m = array(); // Do we have units we need to convert? if (preg_match('/^(.*)([KMG]B)$/',$y,$m)) { // Our number is in m[1] $y = $m[1]; // Our unit is in m[2], convert to bytes switch ($m[2]) { case 'GB': $y *= 1024; case 'MB': $y *= 1024; case 'KB': $y *= 1024; } } // Safety check to make sure we extracted what we wanted. if ($y == $this->MESSAGE) throw new Kohana_Exception('Unable to extra data from message :id [:msg]',array(':id'=>$this->MSGNO,':msg'=>$this->MESSAGE)); return array($x[$this->MSGNO]['id']=>str_replace(',','',$y)); } /** * Return this ACTIVITY LOG start time in seconds since epoch */ public function start() { return ORM_TSM::date($this->DATE_TIME,'U'); } } ?>