$averagemessagesweekraw=($this->data['processed_emails'][1])/7;//average messages per day, computed over the past week
$averagemessagesmonthraw=($this->data['processed_emails'][2])/30;//average messages per day, computed over the past month
$averagemessagestotalraw=($this->data['counters']['rcvd'])/$total_number_days;//average messages per day, computed over the time period since the first email was archived
/* message size variables */
$averagemessagesizeraw=$archivesizeraw/$this->data['counters']['rcvd'];//average message size, computed for total messages in database
$averagesqlsizeraw=$sqlsizeraw/$this->data['counters']['rcvd'];//average message metadata size, computed for total messages in database
$averagesphinxsizeraw=$sphinxsizeraw/$this->data['counters']['rcvd'];//average message sphinx index size, computed for total messages in database
$averagesizedayraw=($averagemessagesizeraw+$averagesqlsizeraw+$averagesphinxsizeraw)*$averagemessagestotalraw;//average total message size per day, computed over the time period since the first email was archived
if($part['partition']==DATA_PARTITION){$datapart=$part['freespace']*1024;}// if the partition is the selected storage partition, record freespace on that partition
$this->data['oldestmessagets']=$oldest_record_timestamp;// date of the oldest record in the db
$this->data['averagemessages']=round($averagemessagesweekraw);// rounded average of messages over the past week
$this->data['averagemessagesize']=nice_size($averagemessagesizeraw,' ');// formatted average message size on disk
$this->data['averagesqlsize']=nice_size($averagesqlsizeraw,' ');// formatted average metadata size in sql
$this->data['averagesphinxsize']=nice_size($averagesphinxsizeraw,' ');// formatted average sphinx index
$this->data['averagesizeday']=nice_size($averagesizedayraw,' ');// formatted average size per day
$this->data['daysleftatcurrentrate']=convert_days_ymd($datapart/$averagesizedayraw);// estimated number of days of free space left
if($averagemessagesweekraw>$averagemessagesmonthraw){// determine if the trend of the last week compared to the last month is increasing, decreasing, or neutral (only applies to message count, not size)