2002-08-04 18:00:11 +00:00
|
|
|
/** GSWStatisticsStore.m - <title>GSWeb: Class GSWStatisticsStore</title>
|
|
|
|
|
2004-09-01 14:49:27 +00:00
|
|
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
2002-08-04 18:00:11 +00:00
|
|
|
|
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
2003-03-21 14:32:57 +00:00
|
|
|
Date: Jan 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-08-04 18:00:11 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-03-21 14:32:57 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
RCS_ID("$Id$")
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-01-22 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/Makefile.postamble:
o use $(LN_S) -f in install-WO-headers
o added $(MKDIRS) $(GNUSTEP_HEADERS)/$(GSWExtensions_wo_HEADER_FILES_INSTALL_DIR);
* GSWExtensionsGSW.framework/Makefile.postamble: use $(LN_S) -f in install-WO-headers
2003-01-20 David Ayers <d.ayers@inode.at>
* Makefile.postamble
o added support for make gswnames=(gsw,wo,all) (corrected
typo)
o reinserted support for $(INSTALL_ROOT_DIR)
* config.h.in
o added HAVE_GDL2
* configure
o added support for --with-gswnames=(gsw,wo,all)
o set LIBWRAP during configure
o added config.mak.in as configurable file
* configure.ac
o (see configure)
* config.mak: removed (replaced by config.mak.in)
* config.mak.in: new file
o added support for make gswnames=(gsw,wo,all)
* gsweb.make.in
o add GSANTLR as auxiliary lib
o add gsweb libs to AUXILIARY_GSW_LIBS
o include correct extensions for GSW/WO-libs
* gsweb_wo.make: new file
* GSWeb/GSWConfig.h
o changed support for GSWEB_WONAMES
o conditionally import file GSWWOCompatiblity
here instead of in GSWeb.h
* GSWeb/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o removed reference to unused files:
GSWeb.m, GSWWOCompatibility.m
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWeb/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
o remove Makefile.preamble during distclean
* GSWeb/Makefile.preamble.in
o fixed typo
* GSWeb/GSWeb.h
o moved GSW/WO-Name-mapping to GSWWOCompatibility.h
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWeb.m: removed
* GSWeb/GSWWOCompatibility.h
o changed GSWEB_WONAMES handling
o removed hybrid namespace WO subclasses
o moved & reorganized GSW/WO-Name-mapping from GSWeb.h
o inlucluded missing GSW/WO-Name-mappings
* GSWeb/GSWWOCompatibility.m: removed
* GSWeb/*.m
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWApplication.m
o remove special GSW/WO handling of WOApp
* GSWeb/WebObject/WO*: removed
* GSWeb/WebObject/WebObjects
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWExtensions/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWExtensions/Makefile.preamble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
* GSWExtensions/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
* GSWExtensions/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtWOCompatibility.h"
o replaces inclusions of
<GSWExtensions/file.h> with "file.h"
* GSWExtensions/GSWExtensions.h: new file
* GSWExtensions/WOExtensions.h: new file
* GSWExtensions/GSWExtWOCompatibility.h: new file
* GSWExtensionsGSW/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new file GSWExtGSWWOCompatibility.h
o added support to create WO header files
* GSWExtensionsGSW/Makefile.pramble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
o removed GSWExtensions from ADDITIONAL_LIB_DIRS
* GSWExtensionsGSW/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtGSWWOCompatibility.h"
* GSWExtensions/GSWExtGSWWOCompatibility.h: new file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@15675 72102866-910b-0410-8b05-ffd578937521
2003-01-22 12:24:26 +00:00
|
|
|
#include "GSWeb.h"
|
2003-10-21 11:15:56 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
#include <sys/resource.h>
|
2003-03-21 14:32:57 +00:00
|
|
|
#include <unistd.h>
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)init
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
if ((self=[super init]))
|
2001-02-23 18:01:19 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
_transactionMovingAverageSampleCount = 100;
|
|
|
|
_sessionMovingAverageSampleCount = 10;
|
|
|
|
ASSIGN(_startDate, [NSDate date]);
|
|
|
|
ASSIGN(_initializationMemory, [self _memoryUsage]);
|
|
|
|
_selfLock = [NSRecursiveLock new];
|
2001-02-23 18:01:19 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
GSWLogC("Dealloc GSWStatisticsStore");
|
|
|
|
GSWLogC("Dealloc GSWStatisticsStore: selfLock");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWStatisticsStore: maxActiveSessionsDate");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_maxActiveSessionsDate);
|
|
|
|
DESTROY(_lastSessionStatistics);
|
|
|
|
DESTROY(_startDate);
|
|
|
|
DESTROY(_lastStatsDate);
|
|
|
|
DESTROY(_initializationMemory);
|
|
|
|
DESTROY(_pagesStatistics);
|
|
|
|
DESTROY(_currentPage);
|
|
|
|
DESTROY(_pathsStatistics);
|
|
|
|
DESTROY(_logPath);
|
|
|
|
DESTROY(_logCreationDate);
|
|
|
|
DESTROY(_password);
|
|
|
|
DESTROY(_directActionStatistics);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWStatisticsStore Super");
|
|
|
|
[super dealloc];
|
|
|
|
GSWLogC("End Dealloc GSWStatisticsStore");
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)unlock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
LoggedUnlock(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn--;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)lock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
LoggedLockBeforeDate(_selfLock, GSW_LOCK_LIMIT);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn++;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-10-28 19:57:10 +00:00
|
|
|
/*
|
|
|
|
should return this:
|
|
|
|
|
|
|
|
2002-10-26 13:50:19.825 foobarWO[3207] stats=<CFDictionary 0xf6fa0 [0x8016024c]>{count = 5, capacity = 6, pairs = (
|
|
|
|
0 : Pages = <CFDictionary 0xf98f0 [0x8016024c]>{count = 1, capacity = 3, pairs = (
|
|
|
|
1 : Main = <CFDictionary 0xfb040 [0x8016024c]>{count = 4, capacity = 6, pairs = (
|
|
|
|
1 : Min Resp. Time = 0.06496943533420562432
|
|
|
|
2 : Max Resp. Time = 0.4728142097592352768
|
|
|
|
3 : Avg Resp. Time = 0.2195588141679763968
|
|
|
|
7 : Served = 5
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
3 : StartedAt = 2002-10-26 13:49:05 +0200
|
|
|
|
5 : Transactions = <CFDictionary 0xf82a0 [0x8016024c]>{count = 11, capacity = 11, pairs = (
|
|
|
|
0 : Component Action Transactions = 6
|
|
|
|
2 : Transaction Rate = 0
|
|
|
|
4 : Direct Action Avg. Transaction Time = 0
|
|
|
|
5 : Transactions = 6
|
|
|
|
7 : Avg. Idle Time = 12.154283278932174848
|
|
|
|
9 : Moving Avg. Idle Time = 12.154283278932174848
|
|
|
|
10 : Direct Action Transactions = 0
|
|
|
|
11 : Component Action Avg. Transaction Time = 0.2195588141679763456
|
|
|
|
12 : Moving Avg. Transaction Time = 0.2195588141679763456
|
|
|
|
13 : Avg. Transaction Time = 0.2195588141679763456
|
|
|
|
15 : Sample Size For Moving Avg. = 100
|
|
|
|
)}
|
|
|
|
6 : Sessions = <CFDictionary 0xfd290 [0x8016024c]>{count = 11, capacity = 11, pairs = (
|
|
|
|
0 : Peak Active Sessions Date = 2002-10-26 13:50:17 +0200
|
|
|
|
1 : Current Active Sessions = 2
|
|
|
|
4 : Peak Active Sessions = 2
|
|
|
|
6 : Avg. Memory Per Session = <CFDictionary 0xf8b00 [0x8016024c]>{count = 2, capacity = 3, pairs = (
|
|
|
|
2 : Virtual = 1388544
|
|
|
|
3 : Resident Set Size = 264192
|
|
|
|
)}
|
|
|
|
9 : Moving Avg. Transactions Per Session = 0
|
|
|
|
10 : Sample Size For Moving Avg. = 10
|
|
|
|
11 : Moving Avg. Session Life = 0
|
|
|
|
12 : Session Rate = 0
|
|
|
|
13 : Avg. Transactions Per Session = 0
|
|
|
|
14 : Avg. Session Life = 0
|
|
|
|
15 : Total Sessions Created = 2
|
|
|
|
)}
|
|
|
|
7 : Memory = <CFDictionary 0xfafe0 [0x8016024c]>{count = 2, capacity = 3, pairs = (
|
|
|
|
2 : Virtual = 541458432
|
|
|
|
3 : Resident Set Size = 1622016
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
*/
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
-(id)statistics
|
|
|
|
{
|
2002-10-28 19:57:10 +00:00
|
|
|
NSMutableDictionary *statDict = [NSMutableDictionary dictionary];
|
|
|
|
NSMutableDictionary *sessionsDict = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
[statDict setObject:_startDate
|
|
|
|
forKey:@"StartedAt"];
|
|
|
|
|
|
|
|
// Sessions
|
|
|
|
|
2004-09-01 14:49:27 +00:00
|
|
|
[sessionsDict setObject:GSWIntToNSString(_sessionsCount)
|
2002-10-28 19:57:10 +00:00
|
|
|
forKey:@"Current Active Sessions"];
|
|
|
|
|
|
|
|
|
|
|
|
[statDict setObject:sessionsDict
|
|
|
|
forKey:@"Sessions"];
|
|
|
|
|
|
|
|
// Pages
|
|
|
|
if (_pagesStatistics) {
|
|
|
|
[statDict setObject:_pagesStatistics
|
|
|
|
forKey:@"Pages"];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return statDict;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)sessionMovingAverageSampleSize
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _sessionMovingAverageSampleCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setSessionMovingAverageSampleSize:(int)aSize
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
_sessionMovingAverageSampleCount=aSize;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)transactionMovingAverageSampleSize
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _transactionMovingAverageSampleCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setTransactionMovingAverageSampleSize:(int)aSize
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
_transactionMovingAverageSampleCount=aSize;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreA)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)_purgePathsStatistics
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_updatePathsStatisticsWithPaths:(id)paths
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
[self _purgePathsStatistics];
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_sessionTerminating:(GSWSession*)aSession
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2004-09-01 14:49:27 +00:00
|
|
|
int activeSessionsCount = 0;
|
|
|
|
NSArray* statistics = nil;
|
|
|
|
NSDate* sessionBirthDate = nil;
|
|
|
|
NSTimeInterval sessionTimeOut = nil;
|
|
|
|
int sessionRequestCounter = 0;
|
2000-01-22 12:49:49 +00:00
|
|
|
//OK
|
2003-11-24 10:18:37 +00:00
|
|
|
LOGObjectFnStart();
|
2004-04-22 12:08:29 +00:00
|
|
|
activeSessionsCount=[GSWApp _activeSessionsCount];
|
|
|
|
statistics=[aSession statistics];
|
|
|
|
sessionBirthDate=nil;
|
|
|
|
sessionTimeOut=0;
|
|
|
|
sessionRequestCounter=0;
|
2003-11-24 10:18:37 +00:00
|
|
|
[self _updatePathsStatisticsWithPaths:statistics];
|
|
|
|
sessionBirthDate=[aSession _birthDate];
|
|
|
|
sessionTimeOut=[aSession timeOut];
|
|
|
|
sessionRequestCounter=[aSession _requestCounter];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)sessionTerminating:(GSWSession*)aSession
|
|
|
|
{
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
[self _sessionTerminating:aSession];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
2003-11-24 10:18:37 +00:00
|
|
|
[self unlock];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_applicationCreatedSession:(GSWSession*)aSession
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2003-11-24 10:18:37 +00:00
|
|
|
int activeSessionsCount=0;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
activeSessionsCount=[[GSWApplication application] _activeSessionsCount];
|
|
|
|
ASSIGN(_maxActiveSessionsDate,[NSDate date]);
|
|
|
|
_maxActiveSessionsCount=max(activeSessionsCount,_maxActiveSessionsCount);
|
|
|
|
_sessionsCount++; //ou activeSessionsCount
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
2003-11-24 10:18:37 +00:00
|
|
|
[self unlock];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_applicationWillHandleRequest
|
|
|
|
{
|
|
|
|
NSTimeInterval idleTimeInterval = 0;
|
|
|
|
NSDate* currentDate=nil;
|
|
|
|
|
|
|
|
currentDate=[NSDate date];
|
|
|
|
|
|
|
|
_transactionsCount++;
|
|
|
|
|
|
|
|
_lastWillHandleRequestTimeInterval = [currentDate timeIntervalSinceDate:_startDate];
|
|
|
|
|
|
|
|
idleTimeInterval = _lastWillHandleRequestTimeInterval - _lastDidHandleRequestTimeInterval;
|
|
|
|
_totalIdleTimeInterval += idleTimeInterval;
|
|
|
|
if (_transactionMovingAverageSampleCount>0)
|
|
|
|
{
|
|
|
|
_movingAverageTransactionsCount++;
|
|
|
|
_movingIdleTimeInterval += idleTimeInterval;
|
|
|
|
if(_movingAverageTransactionsCount > _transactionMovingAverageSampleCount)
|
|
|
|
{
|
|
|
|
_movingIdleTimeInterval -=
|
|
|
|
_movingIdleTimeInterval / (double)_transactionMovingAverageSampleCount;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)applicationWillHandleDirectActionRequest
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
_directActionTransactionsCount++;
|
|
|
|
[self _applicationWillHandleRequest];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)applicationWillHandleWebServiceRequest
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
_webServiceTransactionsCount++;
|
|
|
|
[self _applicationWillHandleRequest];
|
2002-10-28 19:57:10 +00:00
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)applicationWillHandleComponentActionRequest
|
2002-10-28 19:57:10 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
_componentActionTransactionsCount++;
|
|
|
|
[self _applicationWillHandleRequest];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_updateHandlerStatistics:(NSMutableDictionary*)statistics
|
|
|
|
withKey:(NSString*)aKey
|
|
|
|
handlingTimeInterval:(NSTimeInterval)handlingTimeInterval
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
if (aKey)
|
|
|
|
{
|
|
|
|
NSNumber* AvgRespTime=nil;
|
|
|
|
NSNumber* MinRespTime=nil;
|
|
|
|
NSNumber* MaxRespTime=nil;
|
|
|
|
NSNumber* Served=nil;
|
|
|
|
double AvgRespTimeValue=0;
|
|
|
|
double MinRespTimeValue=0;
|
|
|
|
double MaxRespTimeValue=0;
|
|
|
|
int ServedValue=0;
|
|
|
|
NSMutableDictionary* statsForKey=[statistics objectForKey:aKey];
|
|
|
|
|
|
|
|
NSDebugMLog(@"statsForKey=%@",statsForKey);
|
|
|
|
if (statsForKey)
|
|
|
|
{
|
|
|
|
AvgRespTime=[statsForKey objectForKey:@"Avg Resp. Time"];
|
|
|
|
MinRespTime=[statsForKey objectForKey:@"Min Resp. Time"];
|
|
|
|
MaxRespTime=[statsForKey objectForKey:@"Max Resp. Time"];
|
|
|
|
Served=[statsForKey objectForKey:@"Served"];
|
|
|
|
|
|
|
|
ServedValue=[Served intValue];
|
|
|
|
if (MinRespTime)
|
|
|
|
{
|
|
|
|
MinRespTimeValue=[MinRespTime doubleValue];
|
|
|
|
MinRespTimeValue=min(MinRespTimeValue,handlingTimeInterval);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MinRespTimeValue=handlingTimeInterval;
|
|
|
|
if (MaxRespTime)
|
|
|
|
{
|
|
|
|
MaxRespTimeValue=[MaxRespTime doubleValue];
|
|
|
|
MaxRespTimeValue=max(MaxRespTimeValue,handlingTimeInterval);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
MaxRespTimeValue=handlingTimeInterval;
|
|
|
|
if (AvgRespTime)
|
|
|
|
{
|
|
|
|
AvgRespTimeValue=[AvgRespTime doubleValue];
|
|
|
|
AvgRespTimeValue=((AvgRespTimeValue*ServedValue)+handlingTimeInterval)/(ServedValue+1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
AvgRespTimeValue=handlingTimeInterval;
|
|
|
|
ServedValue++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
statsForKey=(NSMutableDictionary*)[NSMutableDictionary dictionary];
|
|
|
|
[statistics setObject:statsForKey
|
|
|
|
forKey:aKey];
|
|
|
|
AvgRespTimeValue=handlingTimeInterval;
|
|
|
|
MinRespTimeValue=handlingTimeInterval;
|
|
|
|
MaxRespTimeValue=handlingTimeInterval;
|
|
|
|
ServedValue=1;
|
|
|
|
};
|
|
|
|
AvgRespTime=[NSNumber numberWithDouble:AvgRespTimeValue];
|
|
|
|
MinRespTime=[NSNumber numberWithDouble:MinRespTimeValue];
|
|
|
|
MaxRespTime=[NSNumber numberWithDouble:MaxRespTimeValue];
|
|
|
|
Served=[NSNumber numberWithInt:ServedValue];
|
|
|
|
NSDebugMLog(@"AvgRespTime=%@",AvgRespTime);
|
|
|
|
NSDebugMLog(@"MinRespTime=%@",MinRespTime);
|
|
|
|
NSDebugMLog(@"MaxRespTime=%@",MaxRespTime);
|
|
|
|
NSDebugMLog(@"Served=%@",Served);
|
|
|
|
[statsForKey setObject:AvgRespTime
|
|
|
|
forKey:@"Avg Resp. Time"];
|
|
|
|
[statsForKey setObject:MinRespTime
|
|
|
|
forKey:@"Min Resp. Time"];
|
|
|
|
[statsForKey setObject:MaxRespTime
|
|
|
|
forKey:@"Max Resp. Time"];
|
|
|
|
[statsForKey setObject:Served
|
|
|
|
forKey:@"Served"];
|
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(NSTimeInterval)_applicationDidHandleRequest
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
NSTimeInterval handlingTimeInterval=0;
|
|
|
|
NSDate* currentDate=nil;
|
|
|
|
|
|
|
|
currentDate=[NSDate date];
|
|
|
|
|
|
|
|
_lastDidHandleRequestTimeInterval = [currentDate timeIntervalSinceDate:_startDate];
|
|
|
|
handlingTimeInterval = _lastDidHandleRequestTimeInterval - _lastWillHandleRequestTimeInterval;
|
|
|
|
|
|
|
|
_totalTransactionTimeInterval += handlingTimeInterval;
|
|
|
|
if (_transactionMovingAverageSampleCount>0)
|
|
|
|
{
|
|
|
|
_movingTransactionTimeInterval += handlingTimeInterval;
|
|
|
|
if (_movingAverageTransactionsCount>_transactionMovingAverageSampleCount)
|
|
|
|
{
|
|
|
|
_movingTransactionTimeInterval -=
|
|
|
|
_movingTransactionTimeInterval / (NSTimeInterval)_transactionMovingAverageSampleCount;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return handlingTimeInterval;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_applicationDidHandleComponentActionRequest
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
NSTimeInterval handlingTimeInterval=[self _applicationDidHandleRequest];
|
|
|
|
_totalCATransactionTimeInterval += handlingTimeInterval;
|
|
|
|
[self _updateHandlerStatistics:_pagesStatistics
|
|
|
|
withKey:_currentPage
|
|
|
|
handlingTimeInterval:handlingTimeInterval];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-11-24 10:18:37 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(NSString*)actionName
|
|
|
|
{
|
|
|
|
NSTimeInterval handlingTimeInterval=[self _applicationDidHandleRequest];
|
|
|
|
_totalDATransactionTimeInterval += handlingTimeInterval;
|
|
|
|
[self _updateHandlerStatistics:_directActionStatistics
|
|
|
|
withKey:actionName
|
|
|
|
handlingTimeInterval:handlingTimeInterval];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)_applicationDidHandleWebServiceRequestWithActionNamed:(NSString*)actionName
|
|
|
|
{
|
|
|
|
NSTimeInterval handlingTimeInterval=[self _applicationDidHandleRequest];
|
|
|
|
_totalWSTransactionTimeInterval += handlingTimeInterval;
|
|
|
|
[self _updateHandlerStatistics:_webServiceStatistics
|
|
|
|
withKey:actionName
|
|
|
|
handlingTimeInterval:handlingTimeInterval];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)applicationDidHandleComponentActionRequestWithPageNamed:(NSString*)pageName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
[self _applicationDidHandleComponentActionRequest];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)applicationDidHandleDirectActionRequestWithActionNamed:(NSString*)actionName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
[self _applicationDidHandleDirectActionRequestWithActionNamed:actionName];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
-(void)applicationDidHandleWebServiceRequestWithActionNamed:(NSString*)actionName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
[self _applicationDidHandleWebServiceRequestWithActionNamed:actionName];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2003-11-24 10:18:37 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreB)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWComponent* page=nil;
|
|
|
|
NSString* description=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
page=[aContext page];
|
|
|
|
description=[page descriptionForResponse:aResponse
|
|
|
|
inContext:aContext];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return description;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)recordStatisticsForResponse:(GSWResponse*)aResponse
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWComponent* page=nil;
|
|
|
|
NSString* pageName=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
page=[aContext page];
|
|
|
|
NSDebugMLog(@"page=%@",page);
|
|
|
|
pageName=[page name];
|
|
|
|
NSDebugMLog(@"pageName=%@",pageName);
|
|
|
|
ASSIGN(_currentPage,pageName);
|
|
|
|
NSDebugMLog(@"_currentPage=%@",_currentPage);
|
|
|
|
[self _memoryUsage];//TODO Delete because it's Just for Test !
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreC)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)logString:(id)aString
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)logFileRotationFrequencyInDays
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _logRotation;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)logFile
|
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* logFile=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
logFile=_logPath;
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],
|
|
|
|
__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return logFile;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void) setLogFile:(id)logFile
|
|
|
|
rotationFrequencyInDays:(double)rotationFrequency
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGN(_logPath,logFile);
|
|
|
|
_logRotation=rotationFrequency;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2003-11-24 10:18:37 +00:00
|
|
|
+(NSString*)formatDescription:(NSString*)description
|
|
|
|
forResponse:(GSWResponse*)aResponse
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2003-11-24 10:18:37 +00:00
|
|
|
NSString* formattedDescr=nil;
|
|
|
|
// public String formatDescription(String s, WOResponse woresponse, WOContext wocontext)
|
|
|
|
if (description)
|
|
|
|
{
|
|
|
|
GSWRequest* request = [aContext request];
|
|
|
|
NSString* remoteHost=nil;
|
|
|
|
NSString* remoteUser=nil;
|
|
|
|
NSString* requestMethod=nil;
|
|
|
|
NSString* httpVersion=nil;
|
|
|
|
if (request)
|
|
|
|
{
|
|
|
|
remoteHost=[request headerForKey:GSWHTTPHeader_RemoteHost[GSWebNamingConv]];
|
|
|
|
if ([remoteHost length]==0)
|
|
|
|
{
|
|
|
|
remoteHost=[request headerForKey:GSWHTTPHeader_RemoteAddress[GSWebNamingConv]];
|
|
|
|
if ([remoteHost length]==0)
|
|
|
|
remoteHost=@"-";
|
|
|
|
};
|
|
|
|
remoteUser=[request headerForKey:GSWHTTPHeader_RemoteUser[GSWebNamingConv]];
|
|
|
|
if ([remoteHost length]==0)
|
|
|
|
{
|
|
|
|
remoteUser=@"-";
|
|
|
|
};
|
|
|
|
requestMethod=[request method];
|
|
|
|
httpVersion=[request httpVersion];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
remoteHost=@"?";
|
|
|
|
remoteUser=@"?";
|
|
|
|
requestMethod=@"?";
|
|
|
|
httpVersion=@"?";
|
|
|
|
};
|
|
|
|
description = [description stringByReplacingString:@" "
|
|
|
|
withString:@"_"];
|
|
|
|
formattedDescr=[NSString stringWithFormat:@"%@ - %@ [%@] \"%@ %@/%@ %@\" %u %u\n",
|
|
|
|
remoteHost,
|
|
|
|
remoteUser,
|
|
|
|
[NSDate date],
|
|
|
|
requestMethod,
|
|
|
|
[[GSWApplication application]name],
|
|
|
|
description,
|
|
|
|
httpVersion,
|
|
|
|
(unsigned int)[aResponse status],
|
|
|
|
(unsigned int)[aResponse _contentDataLength]];
|
|
|
|
};
|
|
|
|
return formattedDescr;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreD)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)_password
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _password;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDictionary*)_pathsStatistics
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _pathsStatistics;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDictionary*)_pagesStatistics
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _pagesStatistics;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)_lastSessionStatistics
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDictionary*)_memoryUsage
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
struct rusage rusageStruct;
|
2000-01-22 12:49:49 +00:00
|
|
|
int i=0;
|
|
|
|
LOGObjectFnStart();
|
2000-02-14 10:57:55 +00:00
|
|
|
//Use NSRealMemoryAvailable ??
|
2000-01-22 12:49:49 +00:00
|
|
|
for(i=0;i<2;i++)
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
memset(&rusageStruct,0,sizeof(rusageStruct));
|
|
|
|
if (getrusage(i>0 ? RUSAGE_CHILDREN : RUSAGE_SELF,&rusageStruct)!=0)
|
|
|
|
{
|
|
|
|
LOGError(@"getrusage faled %d",errno);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NSTimeInterval userTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_utime);
|
|
|
|
NSTimeInterval systemTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_stime);
|
|
|
|
NSDebugMLog(@"userTime=%ld",(long)userTime);
|
|
|
|
NSDebugMLog(@"systemTime=%ld",(long)systemTime);
|
|
|
|
NSDebugMLog(@"ru_maxrss=%ld",rusageStruct.ru_maxrss); /* maximum resident set size */
|
|
|
|
NSDebugMLog(@"ru_ixrss=%ld",rusageStruct.ru_ixrss); /* integral shared memory size */
|
|
|
|
NSDebugMLog(@"ru_idrss=%ld",rusageStruct.ru_idrss); /* integral unshared data size */
|
|
|
|
NSDebugMLog(@"ru_isrss=%ld",rusageStruct.ru_isrss); /* integral unshared stack size */
|
|
|
|
NSDebugMLog(@"ru_minflt=%ld",rusageStruct.ru_minflt); /* page reclaims */
|
|
|
|
NSDebugMLog(@"ru_minflt bytes=%ld",rusageStruct.ru_minflt*getpagesize()); /* page reclaims */
|
|
|
|
NSDebugMLog(@"ru_majflt=%ld",rusageStruct.ru_majflt); /* page faults */
|
|
|
|
NSDebugMLog(@"ru_majflt bytes=%ld",rusageStruct.ru_majflt*getpagesize()); /* page faults */
|
|
|
|
NSDebugMLog(@"ru_nswap=%ld",rusageStruct.ru_nswap); /* swaps */
|
|
|
|
NSDebugMLog(@"ru_inblock=%ld",rusageStruct.ru_inblock); /* block input operations */
|
|
|
|
NSDebugMLog(@"ru_oublock=%ld",rusageStruct.ru_oublock); /* block output operations */
|
|
|
|
NSDebugMLog(@"ru_msgsnd=%ld",rusageStruct.ru_msgsnd); /* messages sent */
|
|
|
|
NSDebugMLog(@"ru_msgrcv=%ld",rusageStruct.ru_msgrcv); /* messages received */
|
|
|
|
NSDebugMLog(@"ru_nsignals=%ld",rusageStruct.ru_nsignals); /* signals received */
|
|
|
|
NSDebugMLog(@"ru_nvcsw=%ld",rusageStruct.ru_nvcsw); /* voluntary context switches */
|
|
|
|
NSDebugMLog(@"ru_nivcsw=%ld",rusageStruct.ru_nivcsw); /* involuntary context switches */
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NSDebugMLog(@"ProcInfo:%@",[GSWProcFSProcInfo filledProcInfo]);
|
2002-08-04 18:00:11 +00:00
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//{Committed = 14184448; Reserved = 19025920; }
|
|
|
|
/*
|
|
|
|
sysinfo(struct sysinfo *info);
|
|
|
|
CONFORMING TO
|
|
|
|
This function is Linux-specific, and should not be used in
|
|
|
|
programs intended to be portable.
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
sysinfo returns information in the following structure:
|
|
|
|
|
|
|
|
struct sysinfo {
|
|
|
|
long uptime; // Seconds since boot
|
|
|
|
unsigned long loads[3]; // 1, 5, and 15 minute load average
|
|
|
|
s
|
|
|
|
unsigned long totalram; // Total usable main memory size
|
|
|
|
unsigned long freeram; // Available memory size
|
|
|
|
unsigned long sharedram; // Amount of shared memory
|
|
|
|
unsigned long bufferram; // Memory used by buffers
|
|
|
|
unsigned long totalswap; // Total swap space size
|
|
|
|
unsigned long freeswap; // swap space still available
|
|
|
|
unsigned short procs; // Number of current processes
|
|
|
|
char _f[22]; // Pads structure to 64 bytes
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
LOGObjectFnStop();
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)_averageSessionMemory
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_movingAverageSessionLife
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _movingAverageSessionLife;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_averageSessionLife
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _averageSessionLife;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(float)_movingAverageRequestsPerSession
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _movingAverageRequestsPerSession;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(float)_averageRequestsPerSession
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _averageRequestsPerSession;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDate*)_maxActiveSessionsDate
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _maxActiveSessionsDate;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)_maxActiveSessionsCount
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _maxActiveSessionsCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)_sessionsCount
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _sessionsCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_movingAverageTransactionTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _movingTransactionTimeInterval/_movingAverageTransactionsCount; //?
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_movingAverageIdleTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _movingIdleTimeInterval/_movingAverageTransactionsCount;//??
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_averageCATransactionTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _totalCATransactionTimeInterval/_movingAverageTransactionsCount; //??
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_averageDATransactionTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _totalDATransactionTimeInterval/_movingAverageTransactionsCount; //??
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_averageTransactionTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _totalTransactionTimeInterval/_movingAverageTransactionsCount; //?
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(double)_averageIdleTime
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _totalIdleTimeInterval/_movingAverageTransactionsCount;//??
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)_directActionTransactionsCount
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _directActionTransactionsCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)_componentActionTransactionsCount
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _componentActionTransactionsCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(int)_transactionsCount
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return _transactionsCount;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreE)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(BOOL)validateLogin:(id)aLogin
|
|
|
|
forSession:(id)aSession
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return NO;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setPassword:(NSString*)aPassword
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGN(_password,aPassword);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreF)
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(BOOL)validateLogin:(id)aLogin
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return NO;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreG)
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)_validateAPI
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWStatisticsStore (GSWStatisticsStoreH)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
+(id)timeIntervalDescription:(double)aTimeInterval
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|