<?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">
  <!-- $Id: bytes-by-dir-by-user-by-period.xml,v 1.3 2006/07/23 13:16:35 vanbaal Exp $ -->

<!--
Copyright (C) 2002 Cedric Gross cgross@2blc.com

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
-->

<lire:report-spec xmlns:lire="http://www.logreport.org/LRSML/"
 superservice="ftp" id="bytes-by-dir-by-user-by-period">

 <lire:title>Bytes by Direction by User with count by Period FTP Report</lire:title>
 <lire:description>
  <para>This report shows the bytes transferred by direction (in or
   out) by user with the number of transfers 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.
    </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 during each period.
    </para>
   </lire:description>
  </lire:param>
 </lire:param-spec>

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

 <lire:report-calc-spec>
  <lire:timegroup period="$period" label="Period">

   <lire:group limit="$users_to_show" sort="-user_transfer">
    <lire:field name="username"/>

    <lire:group sort="direction">
     <lire:field name="direction"/>

     <lire:sum name="user_transfer" field="file_size" label="Bytes"/>
     <lire:sum name="transfer_ratio" field="file_size" ratio="table" label="% Total"/>
    </lire:group>
   </lire:group>
  </lire:timegroup>
 </lire:report-calc-spec>

</lire:report-spec>

