<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE lire:report-spec PUBLIC
  "-//LogReport.ORG//DTD Lire Report Specification Markup Language V1.0//EN"
  "http://www.logreport.org/LRSML/1.0/lrsml.dtd">
  <!-- $Id: bytes-by-dir-by-user-by-period.xml,v 1.1 2002/02/09 17:53:27 flacoste 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 or write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
-->

<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">
   <lire:sum name="bytes_total" field="file_size"/>

   <lire:group limit="$users_to_show" sort="-user_transfer">
    <lire:field name="username"/>
    <lire:count name="user_transfer"/>
    <lire:group sort="direction">
     <lire:field name="direction"/>
     <lire:sum name="dir_bytes" field="file_size"/>
    </lire:group>
   </lire:group>
  </lire:timegroup>
 </lire:report-calc-spec>

</lire:report-spec>

