
Hi, after some work I now know that it's quite easy to use the statistic framework to "write" your own statistics. In graph-output mode, each -row- of the table is displayed as one line. I now have the following problem: I use time-related SQL-queries to get the data, e.g. "Date, No. of Tickets" represents one row of the queried date. But that means that the graph-line, in this case just one single line, namly "No. of tickets" is presented by one -column-. The question is: * how can a table (x,y) be "rotated" to (y,x) (sorry, I'm a perl newbie - could you give me a code snip) or * can the statistic framework be told that the columns represent the data-lines. Bye, Alex

Hi Alex,
The question is: * how can a table (x,y) be "rotated" to (y,x) (sorry, I'm a perl newbie - could you give me a code snip) or
8<----------------------------------------------------- my @NewStatArray = (); my $Title = shift(@StatArray); foreach my $Key1 (0..$#StatArray) { foreach my $Key2 (0..$#{$StatArray[0]}) { $NewStatArray[$Key2][$Key1] = $StatArray[$Key1][$Key2]; } } $NewStatArray[0][0] = ''; unshift(@NewStatArray, [$Title]); @StatArray = @NewStatArray; ------------------------------------------------------>8 With kind regards Thomas PS: I make a dynamic-statistic-module for OTRS 2.1. Then it is very easy to make stat settings. In a few month OTRS 2.1 is available.

Hi Thomas, Thomas Raith schrieb:
Hi Alex,
The question is: * how can a table (x,y) be "rotated" to (y,x) (sorry, I'm a perl newbie - could you give me a code snip) or
8<----------------------------------------------------- my @NewStatArray = (); my $Title = shift(@StatArray); foreach my $Key1 (0..$#StatArray) { foreach my $Key2 (0..$#{$StatArray[0]}) { $NewStatArray[$Key2][$Key1] = $StatArray[$Key1][$Key2]; } } $NewStatArray[0][0] = ''; unshift(@NewStatArray, [$Title]); @StatArray = @NewStatArray; ------------------------------------------------------>8
Thanks a lot for you help! I wanted to move your code * from an specific Stat-extension on ~/Kernel/System/Stats/. (where it works) * to ~/Kernel/Module/SystemStats.pm (about line 170) to be executed on certain conditions #-------------------------- my $TitleArrayRef = shift (@Data); my $Title = $TitleArrayRef->[0]; my @NewData = (); foreach my $Key1 (0..$#Data) { foreach my $Key2 (0..$#{$Data[0]}) { $NewData[$Key2][$Key1] = $Data[$Key1][$Key2]; } } @Data = @NewData; my $HeadArrayRef = shift (@Data); #-------------------------- This code seems not to be executed - why? I also edited some other parts in SystemStats.pm but I couldn't recognize any changes in OTRS-behaviour - why? One further problem: My own statistics work fine with print output format, but often apache-errors are sent to the client on graphical output: Some combinations of graph-output-types and resolutions work, others don't. apache-error-log contains: [Tue May 16 07:50:11 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:50:17 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 16. [Tue May 16 07:50:24 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:50:28 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:51:32 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. *** glibc detected *** free(): invalid pointer: 0x09be6364 *** [Tue May 16 07:51:37 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:51:47 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09b971b4 *** [Tue May 16 07:51:51 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 12. [Tue May 16 07:52:48 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:54 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:58 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:54:31 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 340. [Tue May 16 07:55:01 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09bedef4 *** Do you know this problem?
With kind regards
Thomas
PS: I make a dynamic-statistic-module for OTRS 2.1. Then it is very easy to make stat settings. In a few month OTRS 2.1 is available.
That sounds great! Bye, Alex

Hi Alex, On Di, Mai 16, 2006 at 10:12:15 +0200, Alexander Scholler wrote:
Thomas Raith schrieb:
Hi Alex,
The question is: * how can a table (x,y) be "rotated" to (y,x) (sorry, I'm a perl newbie - could you give me a code snip) or
8<----------------------------------------------------- my @NewStatArray = (); my $Title = shift(@StatArray); foreach my $Key1 (0..$#StatArray) { foreach my $Key2 (0..$#{$StatArray[0]}) { $NewStatArray[$Key2][$Key1] = $StatArray[$Key1][$Key2]; } } $NewStatArray[0][0] = ''; unshift(@NewStatArray, [$Title]); @StatArray = @NewStatArray; ------------------------------------------------------>8
Thanks a lot for you help!
I wanted to move your code * from an specific Stat-extension on ~/Kernel/System/Stats/. (where it works) * to ~/Kernel/Module/SystemStats.pm (about line 170) to be executed on certain conditions
#-------------------------- my $TitleArrayRef = shift (@Data); my $Title = $TitleArrayRef->[0];
my @NewData = (); foreach my $Key1 (0..$#Data) { foreach my $Key2 (0..$#{$Data[0]}) { $NewData[$Key2][$Key1] = $Data[$Key1][$Key2]; } } @Data = @NewData;
my $HeadArrayRef = shift (@Data); #--------------------------
This code seems not to be executed - why? I also edited some other parts in SystemStats.pm but I couldn't recognize any changes in OTRS-behaviour - why?
One further problem:
My own statistics work fine with print output format, but often apache-errors are sent to the client on graphical output: Some combinations of graph-output-types and resolutions work, others don't.
apache-error-log contains:
[Tue May 16 07:50:11 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:50:17 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 16. [Tue May 16 07:50:24 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:50:28 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:51:32 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. *** glibc detected *** free(): invalid pointer: 0x09be6364 *** [Tue May 16 07:51:37 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:51:47 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09b971b4 *** [Tue May 16 07:51:51 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 12. [Tue May 16 07:52:48 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:54 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:58 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:54:31 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 340. [Tue May 16 07:55:01 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09bedef4 ***
Do you know this problem?
It looks like you are using values / vars that are initialized somwhere else and access is not given to this vars. Because we do not have these problems it looks like the errors are caused by the code you are trying to insert into the module. Unfortunatly we only can help you with this problem after we researched the issue more detailed, we'd need more time to see whats really going on and we would need the whole code. But helping this way is only possible with a commercial order, sorry :(.
Bye, Alex
Kind regards, Christian -- ((otrs)) :: OTRS GmbH :: Europaring 4 :: D - 94315 Straubing Fon: +49 (0) 9421 1862 760 :: Fax: +49 (0) 9421 1862 769 http://www.otrs.com/ :: Communication with success!
participants (3)
-
Alexander Scholler
-
Christian Schoepplein
-
Thomas Raith