New Release of the Statistics package

Hello list,
I am pleased to release a new version of the statistics package. This
version is independent of mod_perl and intended for use with RT 3.
Usability with RT 2 is not tested or aimed at. Prerequisites are a
working RT 3 installation and GD::Graph. Apache::GD::Graph is not
needed, and no reconfiguration of the web server is needed.
Graphs are by default written in png format.

The statistics package is an adaptation of the famous statistics
package originally written by Simon Cozens. This is the first release
by me, the new maintainer.

Put the Tabs in /local/html/Elements/ if You want to
select the Statistics pages from the web ui. Extract the
Statistics3.tgz to /share/html.
Have fun with Statistics.

Please be reminded that this is only a pre release, as this contains
some documented and undocumented hacks.

Known bugs/Missing features:

  • no localization - everything is in english.
  • no parametrization of graphs
  • the ‘Calls by Day’ statistics page does not scale well with high
    amounts of tickets. It needs almost a minute to load on a P4/1000 with
    a ~4800 tickets database
  • The ‘Time to Resolve’ statistics page might render strange graphs on
    days where no ticket has been resolved yet.

Any suggestions to improvement of code, feature requests etc. are very
welcome!

Jesse, would you mind putting this into the rt 3 contrib directory?

Regards,
Harald Wagener

Tabs (2.55 KB)

Statistics3.tgz (6.37 KB)

Hello list,

Hello Harold!

I am pleased to release a new version of the statistics package. This

Any suggestions to improvement of code, feature requests etc. are very
welcome!

Just a couple of thoughts:

  1. If you change your Tabs so that the path => ‘Statistics/index.html’ then
    the whole kit and kaboodle can sit in local. The problem is that if
    “Statistics/index.html” does not exist in the mason master directory then it
    will not do the Statistics/ → Statistics/index.html expansion. This of
    course also needs to be done in Statistics/Elements/Tabs. This is very
    useful for us on Debian, since then we can just drop the whole lot into
    /usr/local/share/request-tracker3/html.

  2. (I know I run a screwy setup but) if you can include relative paths for
    the Charts then you can see them even if the name resolution does not work.
    This sometimes happens on VLANS when you are forced to access the site by IP
    :wink:

  3. What would also be useful is an overview of the total of open and/or
    stalled tickets for a queue.

  4. Thanks for all the great work!

  5. Hope this helps :slight_smile:

Cheers,
Paul

I also have the debian install, Rt 3.0.2 on my test server

I copied Tabs in /usr/share/request-tracker3/html/Elements/Tabs
And untared Statistics in /usr/share/request-tracker3/html

I see the pages and the tab.
But I always get the result with maximal ticket numbers, I lookup up the
log, this is repeated a couple of times:

[Thu Jul 24 16:36:11 2003] [error]: Invalid Date Op: <= at
/usr/share/perl5/RT/T
ickets_Overlay.pm line 347.

Stack:
[/usr/share/perl5/HTML/Mason/Request.pm:283]
[/usr/share/perl5/RT/Tickets_Overlay.pm:347]
[/usr/share/perl5/RT/Tickets_Overlay_SQL.pm:222]
[/usr/share/perl5/RT/Tickets_Overlay_SQL.pm:301]
[/usr/share/perl5/RT/Tickets_Overlay.pm:1970]
[/usr/share/perl5/RT/Tickets_Overlay.pm:1688]

[/usr/share/request-tracker3/html/Statistics/CallsQueueDay/index.html:42
]
[/usr/share/request-tracker3/html/autohandler:171]
(/usr/share/perl5/RT/Tickets_Overlay_SQL.pm:302)

Invalid Date Operator, perhaps it is something with my Date format
settings?
When I instert date and time in RT, for example for due I use following
syntax DD/MM/YYYY HH:MM

Samuel SenonerFrom: Paul Wagland [mailto:pwagland@allshare.nl]
Sent: Thursday,24 July,2003 15:06
To: Harald Wagener
Cc: Rt-Devel@Lists. Fsck. Com
Subject: RE: [rt-devel] New Release of the Statistics package

Hello list,

Hello Harold!

I am pleased to release a new version of the statistics package. This
Any suggestions to improvement of code, feature requests etc.
are very welcome!

Just a couple of thoughts:

  1. If you change your Tabs so that the path => ‘Statistics/index.html’
    then the whole kit and kaboodle can sit in local. The problem is that if
    “Statistics/index.html” does not exist in the mason master directory
    then it will not do the Statistics/ → Statistics/index.html expansion.
    This of course also needs to be done in Statistics/Elements/Tabs. This
    is very useful for us on Debian, since then we can just drop the whole
    lot into /usr/local/share/request-tracker3/html.

  2. (I know I run a screwy setup but) if you can include relative paths
    for the Charts then you can see them even if the name resolution does
    not work. This sometimes happens on VLANS when you are forced to access
    the site by IP
    :wink:

  3. What would also be useful is an overview of the total of open and/or
    stalled tickets for a queue.

  4. Thanks for all the great work!

  5. Hope this helps :slight_smile:

Cheers,
Paul

rt-devel mailing list
rt-devel@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-devel

A new archive with the changes needed to have the Statistics reside in
<oath to rt 3>/local/html only is now available at

http://www.tzi.de/~hollow/Statistics3.tgz

I would welcome any positive reports about this working from people
using mod_perl or speedycgi.

Thanks again to Paul for his valuable input!

Regards,
Harald Wagener

I also have the debian install, Rt 3.0.2 on my test server

I am on 3.0.4 already. Is it possible for You to upgrade and test again?

I copied Tabs in /usr/share/request-tracker3/html/Elements/Tabs

This is not ideal, since You copied over the original Tabs. It should
not break anything, but the changes for the Statistics will vanish if
You upgrade to a newer version.

And untared Statistics in /usr/share/request-tracker3/html

I see the pages and the tab.
But I always get the result with maximal ticket numbers, I lookup up
the
log, this is repeated a couple of times:

[Thu Jul 24 16:36:11 2003] [error]: Invalid Date Op: <= at
/usr/share/perl5/RT/Tickets_Overlay.pm line 347.

Stack:

[snip]

[/usr/share/request-tracker3/html/Statistics/CallsQueueDay/index.html:
42
]

I have no idea on this. Can we trust the line numbers? line 42 of
CallsQueueDay/index.html is

<%tix->Count%>

for me…

Invalid Date Operator, perhaps it is something with my Date format
settings?

The statistics code normalises all the date to ISO date formatting, so
this should not be a problem. We have the same date format as You over
here in germany.

Regards,
Harald

I also have the debian install, Rt 3.0.2 on my test server

I am on 3.0.4 already. Is it possible for You to upgrade and test again?

Invalid Date Operator, perhaps it is something with my Date format
settings?

No. Sam, you need to move up to 3.0.4. This is an issue in 3.0.2 that
was fixed in 3.0.3 or 3.0.4

Jesse

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

  • no localization - everything is in english.

The patch below provides internationalization framework,
as well as s/killed/deleted/ for $status.

Thanks,
/Autrijus/

diff -dur Statistics.old/CallsMultiQueue/Elements/Chart Statistics/CallsMultiQueue/Elements/Chart
— Statistics.old/CallsMultiQueue/Elements/Chart Thu Jul 24 20:01:10 2003
+++ Statistics/CallsMultiQueue/Elements/Chart Fri Jul 25 14:38:59 2003
@@ -1,28 +1,22 @@
-<%perl>
-print $graph->plot(@data)->$format();
-$m->abort();
-print “”;
-print $#data+1 . " Plot Elements:

";
-for (0…$#data) {

  • print $data[$_];
  • print “

    ”;
    -}
    -print “x_labels:

    ”;
    -print $ARGS{x_labels};
    -print “

    ”;
    -print “legend:

    ”;
    -print $ARGS{set_legend};
    -print “

    ”;
    +% $m->print($graph->plot(@data)->$format());
    +% $m->abort();
    +<&|/l, $#data+1&>[1] Plot Elements</&>


    +% foreach my $value (@data) {
    +<% $value %>


    +% }
    +<&|/l&>x_labels</&>:


    +<% $ARGS{x_labels} %>
    +


    +<&|/l&>legend</&>:


    +<% $ARGS{set_legend} %>
    +


    +<&|/l, (keys %ARGS) - 2&>[1] data sets</&>:


    +% for (1…(scalar keys %ARGS)-2) {
    +<% $
    %> <% $ARGS{"data$
    "} %>


    +% }

-print “”;
-print ((scalar keys %ARGS)-2);
-print " data sets:

";
-for (1…(scalar keys %ARGS)-2) {

  • print "$_ ";
  • #print $ARGS{data1};
  • print $ARGS{“data”.$_} . “

    ”;
    -}
    -</%perl>
    <%INIT>
    use GD::Graph::lines;

@@ -31,7 +25,7 @@
my $format = $graph->export_format;
$graph->set(export_format => “png”);
$graph->set_legend(split /,/ , $ARGS{set_legend});
-print $r->header_out(“image/$format”);
+$r->content_type(“image/$format”);
push @data, [split /,/ , $ARGS{x_labels}];
for (1…((scalar keys %ARGS)-2)) {
push @data, [split /,/ , $ARGS{“data”.$_}];
diff -dur Statistics.old/CallsMultiQueue/index.html Statistics/CallsMultiQueue/index.html
— Statistics.old/CallsMultiQueue/index.html Thu Jul 24 20:01:10 2003
+++ Statistics/CallsMultiQueue/index.html Fri Jul 25 14:41:32 2003
@@ -1,5 +1,5 @@
-<& /Elements/Header, Title => ‘RT Statistics: Calls per queue per day’ &>
-<& /Statistics/Elements/Tabs, Title => ‘RT Statistics: Calls per queue per day’ &>
+<& /Elements/Header, Title => loc(‘RT Statistics: Calls per queue per day’) &>
+<& /Statistics/Elements/Tabs, Title => loc(‘RT Statistics: Calls per queue per day’) &>

@@ -12,7 +12,7 @@ - + % my @legend; % for (sort keys %queues) { % push @legend, $_; @@ -52,8 +52,8 @@ % $tix->LimitCreated(VALUE => $dates[$d+1]->ISO, OPERATOR => "<="); % } % } -% elsif ($status eq "killed") { -% $tix->LimitStatus(VALUE => "dead"); +% elsif ($status eq "deleted") { +% $tix->LimitStatus(VALUE => $status); % $tix->LimitLastUpdated(VALUE => $dates[$d]->ISO, OPERATOR => ">="); % if ($dates[$d+1]) { % $tix->LimitLastUpdated(VALUE => $dates[$d+1]->ISO, OPERATOR => "<="); @@ -68,26 +68,26 @@ % }
Dates <&|/l&>Dates

-Show:
+<&|/l&>Show</&>:

-% for (qw(resolved created killed)) {
+% for (qw(resolved created deleted)) {
<OPTION VALUE=“<% $_ %>” <% $_ eq $status && “SELECTED” %>>

  • <% ucfirst $_ %>
  • <% loc($_) %>
    % }

    -Add Queue: -
    +<&|/l&>Add Queue</&>: -
    % while (my $q = $queue->Next) {
    % next if exists $queues{$q->Name} or !$q->CurrentUserHasRight(‘SeeQueue’);<% $q->Name %>

% }

-Days to see:
+<&|/l&>Days to see</&>:

-See weekends:
+<&|/l&>See weekends</&>:
<INPUT TYPE=“checkbox” <% $weekends && ‘CHECKED’ %> name=“weekends”>

-<INPUT TYPE=“submit” VALUE=“Go!”
+<INPUT TYPE=“submit” VALUE=“<&|/l&>Go!</&>”


Only in Statistics.old/CallsQueueDay: .index.html.swp
diff -dur Statistics.old/CallsQueueDay/Elements/Chart Statistics/CallsQueueDay/Elements/Chart
— Statistics.old/CallsQueueDay/Elements/Chart Thu Jul 24 20:01:10 2003
+++ Statistics/CallsQueueDay/Elements/Chart Fri Jul 25 14:37:49 2003
@@ -1,12 +1,9 @@
-<%perl>
-print $graph->plot(@data)->$format();
-$m->abort();
-print $#data+1 . " Elements:

";
-for (0…$#data) {
-print $data[$_];
-print “

”;
-}
-</%perl>
+% $m->print($graph->plot(@data)->$format());
+% $m->abort();
+<&|/l, $#data+1&>[1] Elements</&>:


+% for (0…$#data) {
+<% $data[$
] %>


+% }
<%INIT>
use GD::Graph::lines;

@@ -20,7 +17,7 @@
push @data, [split /,/ , $ARGS{data3}];

my $format = $graph->export_format;
-print $r->header_out(“image/$format”);
+$r->content_type(“image/$format”);
</%INIT>
<%ARGS>
</%ARGS>
diff -dur Statistics.old/CallsQueueDay/index.html Statistics/CallsQueueDay/index.html
— Statistics.old/CallsQueueDay/index.html Thu Jul 24 20:01:10 2003
+++ Statistics/CallsQueueDay/index.html Fri Jul 25 14:41:55 2003
@@ -1,13 +1,13 @@
-<& /Elements/Header, Title => ‘RT Statistics: Calls per day’ &>
-<& /Statistics/Elements/Tabs, Title => ‘RT Statistics: Calls per day’ &>
+<& /Elements/Header, Title => loc(‘RT Statistics: Calls per day’) &>
+<& /Statistics/Elements/Tabs, Title => loc(‘RT Statistics: Calls per day’) &>

- -% for my $status (qw(resolved created killed)) { - +% for my $status (qw(resolved created deleted)) { + % for my $d (0..$#dates) { @@ -15,7 +15,7 @@
Dates <% $status %> + <&|/l&>Dates <% loc($status) %> % }
<% $days[(localtime($dates[$d]->Unix))[6]]." ". (localtime($dates[$d]->Unix))[3]%>

-% for my $status (qw(resolved created killed)) {
+% for my $status (qw(resolved created deleted)) {
% my $tix = new RT::Tickets($session{‘CurrentUser’});


% if ($status eq “resolved”) {
@@ -31,8 +31,8 @@
% $tix->LimitCreated(VALUE => $dates[$d+1]->ISO, OPERATOR => “<=”);
% }
% }
-% elsif ($status eq “killed”) {
-% $tix->LimitStatus(VALUE => “dead”);
+% elsif ($status eq “deleted”) {
+% $tix->LimitStatus(VALUE => $status);
% $tix->LimitLastUpdated(VALUE => $dates[$d]->ISO, OPERATOR => “>=”);
% if ($dates[$d+1]) {
% $tix->LimitLastUpdated(VALUE => $dates[$d+1]->ISO, OPERATOR => “<=”);
@@ -47,13 +47,13 @@
%}

-See Queue:

+<&|/l&>See Queue</&>:

<& /Elements/SelectQueue, Name=>“queue”, ShowNullOption=>0 &>
-Days to see:
+<&|/l&>Days to see</&>:

-See weekends:
+<&|/l&>See weekends</&>:
<INPUT TYPE=“checkbox” <% $weekends && ‘CHECKED’ %> name=“weekends”>
-<INPUT TYPE=“submit” VALUE=“Go!”
+<INPUT TYPE=“submit” VALUE=“<&|/l&>Go!</&>”


<%perl> @@ -71,8 +71,8 @@
- Resolved Created - Killed
+ <&|/l&>Resolved <&|/l&>Created + <&|/l&>Killed

<%ARGS>
$max => 5
diff -dur Statistics.old/DayOfWeek/Elements/Chart Statistics/DayOfWeek/Elements/Chart
— Statistics.old/DayOfWeek/Elements/Chart Fri Jul 25 14:39:28 2003
+++ Statistics/DayOfWeek/Elements/Chart Fri Jul 25 14:39:04 2003
@@ -1,12 +1,9 @@
-<%perl>
-print $graph->plot(@data)->$format();
-$m->abort();
-print $#data+1 . " Elements:

";
-for (0…$#data) {
-print $data[$_];
-print “

”;
-}
-</%perl>
+% $m->print($graph->plot(@data)->$format());
+% $m->abort();
+<&|/l, $#data+1&>[1] Elements</&>:


+% for (0…$#data) {
+<% $data[$
] %>


+% }
<%INIT>
use GD::Graph::bars;

@@ -20,7 +17,7 @@
push @data, [split /,/ , $ARGS{data3}];

my $format = $graph->export_format;
-print $r->header_out(“image/$format”);
+$r->content_type(“image/$format”);
</%INIT>
<%ARGS>
</%ARGS>
diff -dur Statistics.old/DayOfWeek/index.html Statistics/DayOfWeek/index.html
— Statistics.old/DayOfWeek/index.html Thu Jul 24 20:01:10 2003
+++ Statistics/DayOfWeek/index.html Fri Jul 25 14:42:28 2003
@@ -1,30 +1,30 @@
-<& /Elements/Header, Title =>‘RT Statistics: Calls by Day Of Week’ &>
-<& /Statistics/Elements/Tabs, Title =>‘RT Statistics: Calls by Day Of Week’ &>
+<& /Elements/Header, Title =>loc(‘RT Statistics: Calls by Day Of Week’) &>
+<& /Statistics/Elements/Tabs, Title =>loc(‘RT Statistics: Calls by Day Of Week’) &>

-

Number of Tickets Handled in <% $QueueObj->Name %> Per Day


+

<&|/l, $QueueObj->Name&>Number of Tickets Handled in [_1] Per Day</&>

- -% for my $status (qw(resolved created killed)) { - +% for my $status (qw(resolved created deleted)) { + % for my $d (0..$#days) { - -% for my $status (qw(resolved created killed)) { + +% for my $status (qw(resolved created deleted)) { % } % }
Dates <% $status %> + <&|/l&>Dates <% loc($status) %> % }
<% $days[$d] %> <% loc($days[$d]) %> <% $counts[$d]{$status} %>

-See Queue:

+<&|/l&>See Queue</&>:

<& /Elements/SelectQueue, Name=>“queue”, ShowNullOption=>0 &>


-<INPUT TYPE=“submit” VALUE=“Go!”
+<INPUT TYPE=“submit” VALUE=“<&|/l&>Go!</&>”


@@ -36,7 +36,7 @@ chop $url; $url .= "&";

-my @things = qw(resolved created killed);
+my @things = qw(resolved created deleted);
for my $th (0…$#things) {
$url .= “data”.(1+$th).“=”.(join “,”, map { $counts[$_]{$things[$th]} } (0…6)).“&”;
}
@@ -44,8 +44,8 @@
</%perl>



- Resolved Created
- Killed

+ <&|/l&>Resolved</&> <&|/l&>Created</&>
+ <&|/l&>Killed</&>

<%ARGS>
$max => 5
@@ -72,8 +72,8 @@
while (my $t = $tix->RT::SearchBuilder::Next) { # BLOODY HACK
$counts[(localtime($t->ResolvedObj->Unix))[6]]{resolved}++
if $t->Status eq “resolved”;

  •    $counts[(localtime($t->LastUpdatedObj->Unix))[6]]{killed}++
    
  •        if $t->Status eq "dead";
    
  •    $counts[(localtime($t->LastUpdatedObj->Unix))[6]]{deleted}++
    
  •        if $t->Status eq "deleted";
       $counts[(localtime($t->CreatedObj->Unix))[6]]{created}++
    
    }
    }
    diff -dur Statistics.old/Elements/CallTabs Statistics/Elements/CallTabs
    — Statistics.old/Elements/CallTabs Thu Jul 24 20:01:10 2003
    +++ Statistics/Elements/CallTabs Thu Jul 24 20:02:00 2003
    @@ -1,11 +1,11 @@
    <%INIT>
  • my $tabs = { CallsByDay => { title => ‘Calls per Queue per day’,
  • my $tabs = { CallsByDay => { title => loc(‘Calls per Queue per day’),
    path => ‘CallsByDay.html’
    },
  •      CallsMultiQueue => { title => 'Calls by Multiple Queues per day',
    
  •      CallsMultiQueue => { title => loc('Calls by Multiple Queues per day'),
      	   path => 'CallsMultiQueue.html',
      	 },
    
  •      DayOfWeek => { title => 'Calls by Day Of Week',
    
  •      DayOfWeek => { title => loc('Calls by Day Of Week'),
      	   path => 'DayOfWeek.html',
      	 }
       };
    

diff -dur Statistics.old/Elements/DurationAsString Statistics/Elements/DurationAsString
— Statistics.old/Elements/DurationAsString Thu Jul 24 20:01:10 2003
+++ Statistics/Elements/DurationAsString Thu Jul 24 20:02:39 2003
@@ -1,4 +1,4 @@
-<%$days|‘00’%> days <%$hours|‘00’%>:<%$minutes|‘00’%>
+<%$days|‘00’%> <&|/l&>days</&> <%$hours|‘00’%>:<%$minutes|‘00’%>
<%INIT>

my $MINUTE = 60;
diff -dur Statistics.old/Resolution/Elements/Chart Statistics/Resolution/Elements/Chart
— Statistics.old/Resolution/Elements/Chart Thu Jul 24 20:01:10 2003
+++ Statistics/Resolution/Elements/Chart Fri Jul 25 14:39:12 2003
@@ -1,12 +1,9 @@
-<%perl>
-print $graph->plot(@data)->$format();
-$m->abort();
-print $#data+1 . " Elements:

";
-for (0…$#data) {
-print $data[$_];
-print “

”;
-}
-</%perl>
+% $m->print($graph->plot(@data)->$format());
+% $m->abort();
+<&|/l, $#data+1&>[1] Elements</&>:


+% for (0…$#data) {
+<% $data[$
] %>


+% }
<%INIT>
use GD::Graph::lines;

@@ -20,7 +17,7 @@
push @data, [split /,/ , $ARGS{data3}];

my $format = $graph->export_format;
-print $r->header_out(“image/$format”);
+$r->content_type(“image/$format”);
</%INIT>
<%ARGS>
</%ARGS>
diff -dur Statistics.old/Resolution/index.html Statistics/Resolution/index.html
— Statistics.old/Resolution/index.html Thu Jul 24 20:01:10 2003
+++ Statistics/Resolution/index.html Fri Jul 25 14:28:59 2003
@@ -1,15 +1,15 @@
-<& /Elements/Header, Title => ‘RT Statistics: Average Time To Resolution’ &>
-<& /Statistics/Elements/Tabs, Title => “RT Statistics: Average Time To Resolution” &>
+<& /Elements/Header, Title => loc(‘RT Statistics: Average Time To Resolution’) &>
+<& /Statistics/Elements/Tabs, Title => loc(“RT Statistics: Average Time To Resolution”) &>

-

Times for <% $QueueObj->Name || “All Queues” %>


+

<&|/l, $QueueObj->Name || loc(‘All Queues’)&>Times for [_1]</&>

- - - - + + + + % for my $d (0..$#dates) { % my $x = 1; @@ -42,25 +42,25 @@ <& /Statistics/Elements/DurationAsString, Duration => $average &> % $data[$x++][$d] = $average; % } else { - N/A + <&|/l&>N/A % } %}
Dates Tickets Created On This Day Resolved Time to Resolution <&|/l&>Dates <&|/l&>Tickets Created On This Day <&|/l&>Resolved <&|/l&>Time to Resolution

-See Queue:

+<&|/l&>See Queue</&>:

<& /Elements/SelectQueue, Name=>“queue”, ShowNullOption=>1 &>

-Days to see:
+<&|/l&>Days to see</&>:

-See weekends:
+<&|/l&>See weekends</&>:
<INPUT TYPE=“checkbox” <% $weekends && ‘CHECKED’ %> name=“weekends”>




-<INPUT TYPE=“submit” VALUE=“Go!”
+<INPUT TYPE=“submit” VALUE=“<&|/l&>Go!</&>”


diff -dur Statistics.old/TimeToResolve/Elements/Chart Statistics/TimeToResolve/Elements/Chart --- Statistics.old/TimeToResolve/Elements/Chart Thu Jul 24 20:01:10 2003 +++ Statistics/TimeToResolve/Elements/Chart Fri Jul 25 14:39:19 2003 @@ -1,28 +1,22 @@ -<%perl> -print $graph->plot(\@data)->$format(); -$m->abort(); -print ""; -print $#data+1 . " Plot Elements:

"; -for (0..$#data) { - print $data[$_]; - print "

"; -} -print "x_labels:

"; -print $ARGS{x_labels}; -print "

"; -print "legend:

"; -print $ARGS{set_legend}; -print "

"; +% $m->print($graph->plot(\@data)->$format()); +% $m->abort(); +<&|/l, $#data+1&>[_1] Plot Elements

+% foreach my $value (@data) { +<% $value %>

+% } +<&|/l&>x_labels:

+<% $ARGS{x_labels} %> +

+<&|/l&>legend:

+<% $ARGS{set_legend} %> +

+<&|/l, (keys %ARGS) - 2&>[_1] data sets:

+% for (1..(scalar keys %ARGS)-2) { +<% $_ %> <% $ARGS{"data$_"} %>

+% }

-print “”;
-print ((scalar keys %ARGS)-2);
-print " data sets:

";
-for (1…(scalar keys %ARGS)-2) {

  • print "$_ ";
  • #print $ARGS{data1};
  • print $ARGS{“data”.$_} . “

    ”;
    -}
    -</%perl>
    <%INIT>
    use GD::Graph::points;

@@ -30,7 +24,7 @@
my $graph = GD::Graph::points->new(400,300);
my $format = $graph->export_format;
$graph->set(export_format => “png”, marker_size => $ARGS{marker_size});
-print $r->header_out(“image/$format”);
+$r->content_type(“image/$format”);
push @data, [split /,/ , $ARGS{x_labels}];
for (1…((scalar keys %ARGS)-2)) {
push @data, [split /,/ , $ARGS{“data”.$_}];
diff -dur Statistics.old/TimeToResolve/index.html Statistics/TimeToResolve/index.html
— Statistics.old/TimeToResolve/index.html Thu Jul 24 20:01:10 2003
+++ Statistics/TimeToResolve/index.html Fri Jul 25 14:29:46 2003
@@ -1,13 +1,13 @@
-<& /Elements/Header, Title => ‘RT Statistics: Time to Resolve’ &>
-<& /Statistics/Elements/Tabs, Title => ‘Time to Resolve, by ticket’ &>
+<& /Elements/Header, Title => loc(‘RT Statistics: Time to Resolve’) &>
+<& /Statistics/Elements/Tabs, Title => loc(‘Time to Resolve, by ticket’) &>

-See Queue:

+<&|/l&>See Queue</&>:

<& /Elements/SelectQueue, Name=>“queue”, Default => “$queue” &>


-<INPUT TYPE=“submit” VALUE=“Go!”
+<INPUT TYPE=“submit” VALUE=“<&|/l&>Go!</&>”


diff -dur Statistics.old/index.html Statistics/index.html --- Statistics.old/index.html Thu Jul 24 20:01:10 2003 +++ Statistics/index.html Thu Jul 24 20:01:32 2003 @@ -1,6 +1,6 @@ -RT Statistics +<&|/l&>RT Statistics -<& /Elements/Header, Title => 'Statistics' &> -<& /Statistics/Elements/Tabs, Title => 'Statistics' &> +<& /Elements/Header, Title => loc('Statistics') &> +<& /Statistics/Elements/Tabs, Title => loc('Statistics') &>

OK, I upgraded my RT3.0.4 provided with debian with apt-get upgrade.
I get following error selecting a queue on timetoresolve:

error: Can’t locate object method “Next” via package “RT::EasySearch”
(perhaps you forgot to load “RT::EasySearch”?)

I read somewhere that EasySearch is to replace with Searchbuilder.
Harald, do you have a different version with EasySearch?

Thanks

SamuelFrom: Harald Wagener [mailto:hwagener@hamburg.fcb.com]
Sent: Thursday,24 July,2003 18:24
To: rt-devel@lists.fsck.com
Cc: Senoner Samuel
Subject: Re: [rt-devel] New Release of the Statistics package

I also have the debian install, Rt 3.0.2 on my test server

I am on 3.0.4 already. Is it possible for You to upgrade and test again?

I copied Tabs in /usr/share/request-tracker3/html/Elements/Tabs

This is not ideal, since You copied over the original Tabs. It should
not break anything, but the changes for the Statistics will vanish if
You upgrade to a newer version.

And untared Statistics in /usr/share/request-tracker3/html

I see the pages and the tab.
But I always get the result with maximal ticket numbers, I lookup up
the
log, this is repeated a couple of times:

[Thu Jul 24 16:36:11 2003] [error]: Invalid Date Op: <= at
/usr/share/perl5/RT/Tickets_Overlay.pm line 347.

Stack:

[snip]

[/usr/share/request-tracker3/html/Statistics/CallsQueueDay/index.html:
42
]

I have no idea on this. Can we trust the line numbers? line 42 of
CallsQueueDay/index.html is

<%tix->Count%>

for me…

Invalid Date Operator, perhaps it is something with my Date format
settings?

The statistics code normalises all the date to ISO date formatting, so
this should not be a problem. We have the same date format as You over
here in germany.

Regards,
Harald

Sorry. I haven’t downloaded the last version by Harald.
I use debian
I untared the new version in /usr/local/share/request-tracker3/html
I installed with apt-get install libgd-perl the GD::Graph package
After that I installed from CPAN Apache::GD
The statistical package works!!
Great feature!

SamuelFrom: Senoner Samuel
Sent: Monday,28 July,2003 12:57
To: Harald Wagener; rt-devel@lists.fsck.com
Subject: RE: [rt-devel] New Release of the Statistics package

OK, I upgraded my RT3.0.4 provided with debian with apt-get upgrade. I
get following error selecting a queue on timetoresolve:

error: Can’t locate object method “Next” via package “RT::EasySearch”
(perhaps you forgot to load “RT::EasySearch”?)

I read somewhere that EasySearch is to replace with Searchbuilder.
Harald, do you have a different version with EasySearch?

Thanks

Samuel

From: Harald Wagener [mailto:hwagener@hamburg.fcb.com]
Sent: Thursday,24 July,2003 18:24
To: rt-devel@lists.fsck.com
Cc: Senoner Samuel
Subject: Re: [rt-devel] New Release of the Statistics package

I also have the debian install, Rt 3.0.2 on my test server

I am on 3.0.4 already. Is it possible for You to upgrade and test again?

I copied Tabs in /usr/share/request-tracker3/html/Elements/Tabs

This is not ideal, since You copied over the original Tabs. It should
not break anything, but the changes for the Statistics will vanish if
You upgrade to a newer version.

And untared Statistics in /usr/share/request-tracker3/html

I see the pages and the tab.
But I always get the result with maximal ticket numbers, I lookup up
the log, this is repeated a couple of times:

[Thu Jul 24 16:36:11 2003] [error]: Invalid Date Op: <= at
/usr/share/perl5/RT/Tickets_Overlay.pm line 347.

Stack:

[snip]

[/usr/share/request-tracker3/html/Statistics/CallsQueueDay/index.html:
42
]

I have no idea on this. Can we trust the line numbers? line 42 of
CallsQueueDay/index.html is

<%tix->Count%>

for me…

Invalid Date Operator, perhaps it is something with my Date format
settings?

The statistics code normalises all the date to ISO date formatting, so
this should not be a problem. We have the same date format as You over
here in germany.

Regards,
Harald

rt-devel mailing list
rt-devel@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-devel

Aha, don’t need it anymore?? I configured in my apache conf the /chart
location like in the apache::gd doku, so how should it be confiured?
I use mode_perl, this is standard installed in debian.
Debian is very practical in this case.

About more statistics, I whould be interested to know how many time I
spent to resolve tickets with certain custom fields, for example I have
a custom field private PC problems, not belonging to work, and I want to
know how much time I needed for this…

Is something possible??

Thanks

Samuel-----Original Message-----
From: Harald Wagener [mailto:hwagener@hamburg.fcb.com]
Sent: Wednesday,30 July,2003 13:15
To: Senoner Samuel
Subject: Re: [rt-devel] New Release of the Statistics package

On Dienstag, 29. Juli 2003, at 12:04 Uhr, Senoner Samuel wrote:

Sorry. I haven’t downloaded the last version by Harald.
I use debian
I untared the new version in /usr/local/share/request-tracker3/html
I installed with apt-get install libgd-perl the GD::Graph package
After that I installed from CPAN Apache::GD The statistical package
works!! Great feature!

Great to hear that! Actually, You don’t need Apache::GD anymore. Do You
use mod_perl or mod_fastcgi?

Regards,
Harald

Aha, don’t need it anymore?? I configured in my apache conf the /chart
location like in the apache::gd doku, so how should it be confiured?

Apache::GD::Graph only works with mod_perl, and one of my objectives
was to get rid of this dependency, as I use fastcgi, and others
speedycgi. You probably configured Apache::GD right, but it is not
needed anymore, as I call GD::Graph directly from my scripts.

Regards,
Harald

I use mode_perl, this is standard installed in debian.
Debian is very practical in this case.

About more statistics, I whould be interested to know how many time I
spent to resolve tickets with certain custom fields, for example I have
a custom field private PC problems, not belonging to work, and I want
to
know how much time I needed for this…

I have not worked on the searches themselves yet, but You might want to
look at the source code for Yourself and try to figure it out. You
probably need to know a bit about RT::SearchBuilder to find out the
data You want. I am going to write a HOW-TO for making Your own
statistics after I have done an addition or two myself.

Regards,
Harald

Hi

Thanks for taking the time to rewrite this great stats package for
RT3… A few issues/suggestions:

  1. The charts do not work for me. GD::Graph is installed fine and I
    can use the module fine with no errors, however the charts just will
    not show in any browser. If I try and open the image directly in a
    browser, I get the PNG header and a bunch of binary that LOOKS like
    it could be an image, however I cannot open it so it must be
    broken. Is there any way of debugging what the prob is? I’ve tried
    both the libgd1 and libgd2 libraries (and corresponding perl
    modules) with the same problem with both.

  2. I’d LOVE to be able to generate stats for a certain time span, eg
    generate charts for March 1-31, April 1-30, May 1-31, etc and put
    them side-by-side to look at trends. I know this wouldn’t be hard to
    do… What are the chances of this feature coming out soon? If the
    chances are small, I may start looking into RT development to see if
    I can do it… (I’m a perl programmer by trade but have never looked
    in any depth at RT’s code).

Thanks!

Brett.
One way to make your old car run better is to look up the price of a new model.

Hi

Thanks for taking the time to rewrite this great stats package for
RT3… A few issues/suggestions:

  1. The charts do not work for me. GD::Graph is installed fine and I
    can use the module fine with no errors, however the charts just will
    not show in any browser. If I try and open the image directly in a
    browser, I get the PNG header and a bunch of binary that LOOKS like
    it could be an image, however I cannot open it so it must be
    broken. Is there any way of debugging what the prob is? I’ve tried
    both the libgd1 and libgd2 libraries (and corresponding perl
    modules) with the same problem with both.

Obvious question first: Is Your browser capable of displaying pngs? Did
You try to save the file to disk and open it with a picture viewer? In
each ‘Chart’ Mason Element, there is a line like

$graph->set(export_format => “png”);

can You change that to
$graph->set(export_format => “jpg”);

and see if jpgs are viewable?

The newest GD:Graph is dependent on libgd2 (not part of the standard
redhat distribution last time I looked (ver. 9)).

  1. I’d LOVE to be able to generate stats for a certain time span, eg
    generate charts for March 1-31, April 1-30, May 1-31, etc and put
    them side-by-side to look at trends. I know this wouldn’t be hard to
    do… What are the chances of this feature coming out soon?

Patches are always welcome (-; I still plan on improving the base
package we have now, since it has come a bit of age already. Also, for
me it is an opportunity to get my hands dirty with perl code again.

If the
chances are small, I may start looking into RT development to see if
I can do it… (I’m a perl programmer by trade but have never looked
in any depth at RT’s code).

You’d be very welcome!

Regards,
Harald

Hi Harald

Sorry for the obvious question, but where can I find this statistics
package
?

The current Release is at

When I try to access the Statistics page I get the following error

error: 32 levels deep in component stack (infinite recursive call?)

context: …
149: die “Cannot make alias without caller”
150: unless defined $Exception::Class::Caller;
151:
152: no strict ‘refs’;
153: *{“$Exception::Class::Caller::$alias”} = sub { $subclass->throw(@_) };
154: }
155:
156: eval $code;
157:

code stack: /usr/local/lib/perl5/site_perl/5.6.1/Exception/Class.pm:153
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm:986
/opt/rt3/local/html/Statistics/Elements/Tabs:49
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/index.html:4
/opt/rt3/share/html/autohandler:163

I am running RT-3-0-4, I am currently running it with perl-5.8, Apache and
mod_perl1

Asif Iqbal
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
There’s no place like 127.0.0.1

I upgraded the Exception::Class to 1.18 to fix that problem. Now I am getting a
different error

error: could not find component for path ‘/Statistics/Elements/Callback’

context: …
149: die “Cannot make alias without caller”
150: unless defined $Exception::Class::Caller;
151:
152: no strict ‘refs’;
153: *{“$Exception::Class::Caller::$alias”} = sub { $subclass->throw(@_) };
154: }
155:
156: eval $code;
157:

code stack: /usr/local/lib/perl5/site_perl/5.6.1/Exception/Class.pm:153
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm:978
/opt/rt3/local/html/Statistics/Elements/Tabs:49
/opt/rt3/local/html/Statistics/index.html:4
/opt/rt3/share/html/autohandler:163

I don’t see any Callback under Statistics/Elements folderOn Sat, 2 Aug 2003, Asif Iqbal wrote:

When I try to access the Statistics page I get the following error

error: 32 levels deep in component stack (infinite recursive call?)

context: …
149: die “Cannot make alias without caller”
150: unless defined $Exception::Class::Caller;
151:
152: no strict ‘refs’;
153: *{“$Exception::Class::Caller::$alias”} = sub { $subclass->throw(@_) };
154: }
155:
156: eval $code;
157:

code stack: /usr/local/lib/perl5/site_perl/5.6.1/Exception/Class.pm:153
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm:986
/opt/rt3/local/html/Statistics/Elements/Tabs:49
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/Elements/Tabs:24
/opt/rt3/local/html/Statistics/index.html:4
/opt/rt3/share/html/autohandler:163

I am running RT-3-0-4, I am currently running it with perl-5.8, Apache and
mod_perl1

Asif Iqbal
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
There’s no place like 127.0.0.1

I upgraded the Exception::Class to 1.18 to fix that problem. Now I am
getting a
different error

error: could not find component for path
‘/Statistics/Elements/Callback’

That file does not exist

code stack:
/usr/local/lib/perl5/site_perl/5.6.1/Exception/Class.pm:153
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm:978
/opt/rt3/local/html/Statistics/Elements/Tabs:49

That line is

$m->comp(‘/Elements/Callback’, tabs => $tabs, %ARGS);

at my copy, which works. This refers to

/Elements/Callback instead of

/Statistics/Elements/Callback

Can You check if Your copy has the same line (although I did not ever
touch that line of code)?

Regards,
Harald

I upgraded the Exception::Class to 1.18 to fix that problem. Now I am
getting a
different error

error: could not find component for path
‘/Statistics/Elements/Callback’

That file does not exist

code stack:
/usr/local/lib/perl5/site_perl/5.6.1/Exception/Class.pm:153
/usr/local/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm:978
/opt/rt3/local/html/Statistics/Elements/Tabs:49

That line is

$m->comp(‘/Elements/Callback’, tabs => $tabs, %ARGS);

at my copy, which works. This refers to

/Elements/Callback instead of

/Statistics/Elements/Callback

Can You check if Your copy has the same line (although I did not ever
touch that line of code)?

I have the same as yours. Well I don’t get that error now. Hmm… But I never
were able to pass the stage where only thing I see is the Title “Statistics” and
Tabs from RT’s main page. Should I not suppose to see something like Resolution
and stuff related to ticket stats. The center page is simply a white page with
nothing in it

Regards,
Harald

Asif Iqbal
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
There’s no place like 127.0.0.1

Obvious question first: Is Your browser capable of displaying pngs?
Did You try to save the file to disk and open it with a picture
viewer? In each ‘Chart’ Mason Element, there is a line like

$graph->set(export_format => “png”);

can You change that to
$graph->set(export_format => “jpg”);

and see if jpgs are viewable?

Hi Harald

I’ve tried changing this, and the format doesn’t seem to have
changed. I’ve reinstalled the GD 2 libraries and the GD 2 perl
modules, restarted httpd a few times in case mason cached
something, and it still generates PNG’s that are broken. (I’ve
tried opening them in Mozilla, IE, Konqueror and Photoshop with no
luck). I can tell they’re supposed to be PNG’s cos they still have
the standard PNG header.

Any more things I can try?
linux: because a PC is a terrible thing to waste
(ksh@cis.ufl.edu put this on Tshirts in '93)

Hi Harald

My Statistics page shows the tabels but no Graphs. It shows broken link.

Hello list,
I am pleased to release a new version of the statistics package. This
version is independent of mod_perl and intended for use with RT 3.
Usability with RT 2 is not tested or aimed at. Prerequisites are a
working RT 3 installation and GD::Graph. Apache::GD::Graph is not

I have GD::Graph installed

needed, and no reconfiguration of the web server is needed.
Graphs are by default written in png format.

I am able to see png format in my browser so png should not be an issue

The statistics package is an adaptation of the famous statistics
package originally written by Simon Cozens. This is the first release
by me, the new maintainer.

Put the Tabs in /local/html/Elements/ if You want to

Done

select the Statistics pages from the web ui. Extract the
Statistics3.tgz to /share/html.
Have fun with Statistics.

Please be reminded that this is only a pre release, as this contains
some documented and undocumented hacks.

Known bugs/Missing features:

  • no localization - everything is in english.
  • no parametrization of graphs
  • the ‘Calls by Day’ statistics page does not scale well with high
    amounts of tickets. It needs almost a minute to load on a P4/1000 with
    a ~4800 tickets database
  • The ‘Time to Resolve’ statistics page might render strange graphs on
    days where no ticket has been resolved yet.

Any suggestions to improvement of code, feature requests etc. are very
welcome!

Jesse, would you mind putting this into the rt 3 contrib directory?

Regards,
Harald Wagener

Asif Iqbal
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
There’s no place like 127.0.0.1