Hello everybody,
I just upgraded an OTRS system from 2.2 to 2.4.6.
Everthing seems fine... But now my customer complains about the Stats
being very slow.
Calling the Overview is ok, but the detail view (Subaction=View) takes 1
minute or more...
So I investigated the situation:
* Kernel::Modules::AgentStats::Run() calls
* Kernel::System::Stats::StatsGet() with StatID => $StatID as the only
argument
* this call takes about 20 seconds -
most of which is spend reading the keys 'UseAsXvalue',
'UseAsValueSeries' and 'UseAsRestriction'
* moving on in AgentStats::Run() we got in the same Subaction a
'Completenesscheck':
my @Notify = $Self->{StatsObject}->CompletenessCheck(
StatData => $Stat,
Section => 'All'
);
* calling Kernel::System::Stats::CompletenessCheck()
* which itself calls Stats::StatsGet() again! And again with the same
StatID (taken from $StatData{StatID}):
# check if the timeperiod is to big or the time scale to small
# used only for fixed time values
# remark time functions should be exportet in external functions
(tr)
if ( $Param{Section} eq 'All' && $StatData{StatType} eq
'dynamic' ) {
my $Stat = $Self->StatsGet( StatID => $StatData{StatID} );
* so there we are for another 20 secs.
* but that's not all. Back in AgentStats::Run() we call
AgentStats::_Notify:
$Output .= $Self->_Notify( StatData => $Stat, Section => 'All'
);
* which calls Kernel::System::Stats::CompletenessCheck() again:
my @Notify = $Self->{StatsObject}->CompletenessCheck(
StatData => $Param{StatData},
Section => $Param{Section},
);
* which makes the third call to Stats::StatsGet() with the same
arguments taking another 20secs.
I don't know what CompletenessCheck() does.
But since I don't see any differences between the 3 calls to StatsGet(),
I strongly think that we do not really need 'em.
One solution coming to mind is caching the results of StatsGet().
Another is to pass $stat (the result of the first call to StatsGet()) to
CompletenessCheck() as an optional argument, so it can skip the
additional calls to StatGet().
Personaly I'd prefer the caching.
Am I making myself clear?
What do you think?
Thanks for any answers,
gerhard
---------------------------------------------------------------------
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/