<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE lire:report-spec PUBLIC
  "-//LogReport.ORG//DTD Lire Report Specification Markup Language V2.0//EN"
  "http://www.logreport.org/LRSML/2.0/lrsml.dtd">
<lire:report-spec xmlns:lire="http://www.logreport.org/LRSML/"
 superservice="ftp" id="bytes-by-period-by-user">

 <lire:title>Bytes by Period by User FTP Report</lire:title>
 <lire:description>
  <para>This report shows for each user, the amount of bytes they
   transferred by period.
  </para>
 </lire:description>

 <lire:param-spec>
  <lire:param name="period" type="duration" default="1d">
   <lire:description>
    <para>This parameter controls the time period which is used to
     aggregate the records for each users.
    </para>
   </lire:description>
  </lire:param>

  <lire:param name="users_to_show" type="int" default="10">
   <lire:description>
    <para>This parameter controls the number of users to
     display in the report.
    </para>
   </lire:description>
  </lire:param>
 </lire:param-spec>

 <lire:display-spec>
  <lire:title>Total Bytes Transferred by $period Period by User, Top
   $users_to_show users</lire:title>
 </lire:display-spec>

 <lire:report-calc-spec>
  <lire:group limit="$users_to_show" sort="-bytes_total">
   <lire:field name="username"/>

   <lire:timegroup period="$period" label="Period">

    <lire:sum name="bytes_total" field="file_size" label="Bytes"/>
    <lire:sum name="bytes_ratio" field="file_size" ratio="table" label="% Total"/>
    <lire:sum name="bytes_group_ratio" field="file_size" ratio="group" label="% User"/>
   </lire:timegroup>
  </lire:group>
 </lire:report-calc-spec>

</lire:report-spec>

