more msgstore patches

Edwin Groothuis edwin at mavetju.org
Wed Oct 30 06:17:44 CET 2002


Please ignore previous, this one has all:

- new leftover messages / bytes report: how many space does the
  user leave on the server after a session is finished. Yeah use
  of lire:last!

- the msgstore.xml has int for stored_size, should be bytes.

- the dbmail2dlf.in failed at broken logfiles and got its amount
  of stored bytes from the wrong location.

Edwin
 
Index: msgstore//msgstore.cfg
===================================================================
RCS file: /cvsroot/logreport/service/msgstore/msgstore.cfg,v
retrieving revision 1.2
diff -u -r1.2 msgstore.cfg
--- msgstore//msgstore.cfg	24 Sep 2002 11:55:57 -0000	1.2
+++ msgstore//msgstore.cfg	30 Oct 2002 05:11:34 -0000
@@ -13,6 +13,8 @@
 =section Top user
 top-user-login			users_to_show=20
 top-user-select			users_to_show=20
-top-user-most-messages         users_to_show=20
-top-user-most-bytes            users_to_show=20
+top-user-most-messages		users_to_show=20
+top-user-most-bytes		users_to_show=20
+top-user-leftover-messages	users_to_show=20
+top-user-leftover-bytes		users_to_show=20
 
Index: msgstore//msgstore.xml
===================================================================
RCS file: /cvsroot/logreport/service/msgstore/msgstore.xml,v
retrieving revision 1.1
diff -u -r1.1 msgstore.xml
--- msgstore//msgstore.xml	5 Aug 2002 02:43:56 -0000	1.1
+++ msgstore//msgstore.xml	30 Oct 2002 05:11:35 -0000
@@ -116,7 +116,7 @@
   </lire:description>
  </lire:field>
 
- <lire:field name="stored_size" type="int">
+ <lire:field name="stored_size" type="bytes">
   <lire:description>
    <para>Size of the messages stored on the server.</para>
   </lire:description>
Index: msgstore//script/dbmail2dlf.in
===================================================================
RCS file: /cvsroot/logreport/service/msgstore/script/dbmail2dlf.in,v
retrieving revision 1.2
diff -u -r1.2 dbmail2dlf.in
--- msgstore//script/dbmail2dlf.in	24 Sep 2002 12:16:28 -0000	1.2
+++ msgstore//script/dbmail2dlf.in	30 Oct 2002 05:11:37 -0000
@@ -73,6 +73,9 @@
 	# ignore leftovers from previous logfiles
 	next if (!defined $data{$pid}{client_ip});
 
+	$data{$pid}{messages_start}	=0 if (!defined $data{$pid}{messages_start});
+	$data{$pid}{bytes_start}	=0 if (!defined $data{$pid}{bytes_start});
+
 	$data{$pid}{messages_stop}	= $1;
 	$data{$pid}{bytes_stop}	= $2;
 	$data{$pid}{time_stop}	= $rec->{timestamp};
@@ -82,6 +85,9 @@
 	$dlf{bytes_downloaded}	= $data{$pid}{bytes_start} - $data{$pid}{bytes_stop};
 	$dlf{session_duration}	= $data{$pid}{time_stop} - $data{$pid}{time_start};
 
+	$dlf{stored_messages}	= $data{$pid}{messages_stop};
+	$dlf{stored_size}	= $data{$pid}{bytes_stop};
+
 	print_dlf(\%dlf);
 	$data{$pid}=();
 	next;
@@ -100,8 +106,6 @@
 
 	$dlf{user}	= $data{$pid}{user};
 	$dlf{prot_cmd}	= "login";
-	$dlf{stored_messages}	= $data{$pid}{messages_start};
-	$dlf{stored_size}	= $data{$pid}{bytes_start};
 	print_dlf(\%dlf);
 
 	next;
--- msgstore/reports/top-user-leftover-bytes.xml	Wed Oct 30 16:01:16 2002
+++ msgstore/reports/top-user-leftover-bytes.xml	Wed Oct 30 16:01:16 2002
@@ -0,0 +1,46 @@
+<?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">
+<lire:report-spec xmlns:lire="http://www.logreport.org/LRSML/"
+ superservice="msgstore" id="top-user-leftover-bytes">
+
+ <lire:title>Top User Most Message Leftover in Store Report</lire:title>
+ <lire:description>
+  <para>This report specification will generate a report showing the
+   the users that transported the most bytes from the messsage
+   store. The number of users to include in the report is configurable.
+  </para>
+ </lire:description>
+
+ <lire:param-spec>
+  <lire:param name="users_to_show" type="int" default="10">
+   <lire:description>
+    <para>This parameter controls the number of users to include in
+     the report.</para>
+   </lire:description>
+  </lire:param>
+ </lire:param-spec>
+
+ <lire:display-spec>
+  <lire:title>Users With Most Bytes Leftover, Top $users_to_show</lire:title>
+ </lire:display-spec>
+
+ <lire:filter-spec>
+  <lire:eq arg1="$prot_cmd" arg2="close"/>
+ </lire:filter-spec>
+
+ <lire:report-calc-spec>
+  <lire:group sort="-bytes_downloaded_total" limit="$users_to_show">
+   <lire:field name="user"/>
+   <lire:last name="bytes_downloaded_total" field="stored_size"/>
+  </lire:group>
+ </lire:report-calc-spec>
+
+</lire:report-spec>
+
+<!-- 
+Keep this comment at the end of the file
+Local variables:
+mode: xml
+-->
--- msgstore/reports/top-user-leftover-messages.xml	Wed Oct 30 16:01:16 2002
+++ msgstore/reports/top-user-leftover-messages.xml	Wed Oct 30 16:01:16 2002
@@ -0,0 +1,46 @@
+<?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">
+<lire:report-spec xmlns:lire="http://www.logreport.org/LRSML/"
+ superservice="msgstore" id="top-user-leftover-messages">
+
+ <lire:title>Top User Most Message Leftover Store Report</lire:title>
+ <lire:description>
+  <para>This report specification will generate a report showing the
+   the users that transported the most message from the messsage
+   store. The number of users to include in the report is configurable.
+  </para>
+ </lire:description>
+
+ <lire:param-spec>
+  <lire:param name="users_to_show" type="int" default="10">
+   <lire:description>
+    <para>This parameter controls the number of users to include in
+     the report.</para>
+   </lire:description>
+  </lire:param>
+ </lire:param-spec>
+
+ <lire:display-spec>
+  <lire:title>Users With Most Messages Leftover, Top $users_to_show</lire:title>
+ </lire:display-spec>
+
+ <lire:filter-spec>
+  <lire:eq arg1="$prot_cmd" arg2="close"/>
+ </lire:filter-spec>
+
+ <lire:report-calc-spec>
+  <lire:group sort="-messages_downloaded_total" limit="$users_to_show">
+   <lire:field name="user"/>
+   <lire:last name="messages_downloaded_total" field="stored_messages"/>
+  </lire:group>
+ </lire:report-calc-spec>
+
+</lire:report-spec>
+
+<!-- 
+Keep this comment at the end of the file
+Local variables:
+mode: xml
+-->

-- 
Edwin Groothuis      |            Personal website: http://www.MavEtJu.org
edwin at mavetju.org    |    Weblog: http://www.mavetju.org/weblog/weblog.php 
bash$ :(){ :|:&};:   | Interested in MUDs? http://www.FatalDimensions.org/

-- 
To UNSUBSCRIBE, email to development-request at logreport.org with a subject of
"unsubscribe". Trouble? Send an email with subject "help" to
development-request at logreport.org



More information about the Development mailing list