Monotone-Parent: baff79ac3da07f610290a1d61e142dace0bb02a4

Monotone-Revision: 43895973aa7fea1d3dc9024f5b6d44f2298ab592

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-06-13T20:01:10
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-06-13 20:01:10 +00:00
parent 40e2a71a0e
commit 70757493a2
2 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2008-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2008-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Main/SOGo.m ([SOGo -dispatchRequest:_request]): we now report
the time taken by the request, if the "SOGoDebugRequests" user
default is set.
* SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
+objectWithRecord:objectRecordinContainer:newContainer]): new +objectWithRecord:objectRecordinContainer:newContainer]): new
constructor that instantiate an object based on the data found in constructor that instantiate an object based on the data found in

View File

@ -21,6 +21,7 @@
#import <Foundation/NSDebug.h> #import <Foundation/NSDebug.h>
#import <Foundation/NSData.h> #import <Foundation/NSData.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSProcessInfo.h> #import <Foundation/NSProcessInfo.h>
#import <Foundation/NSRunLoop.h> #import <Foundation/NSRunLoop.h>
#import <Foundation/NSURL.h> #import <Foundation/NSURL.h>
@ -71,6 +72,7 @@
static unsigned int vMemSizeLimit = 0; static unsigned int vMemSizeLimit = 0;
static BOOL doCrashOnSessionCreate = NO; static BOOL doCrashOnSessionCreate = NO;
static BOOL hasCheckedTables = NO; static BOOL hasCheckedTables = NO;
static BOOL debugRequests = NO;
#ifdef GNUSTEP_BASE_LIBRARY #ifdef GNUSTEP_BASE_LIBRARY
static BOOL debugObjectAllocation = NO; static BOOL debugObjectAllocation = NO;
@ -94,7 +96,7 @@ static BOOL debugObjectAllocation = NO;
GSDebugAllocationActive (YES); GSDebugAllocationActive (YES);
} }
#endif #endif
debugRequests = [ud boolForKey: @"SOGoDebugRequests"];
/* vMem size check - default is 200MB */ /* vMem size check - default is 200MB */
tmp = [ud objectForKey: @"SxVMemLimit"]; tmp = [ud objectForKey: @"SxVMemLimit"];
@ -392,11 +394,25 @@ static BOOL debugObjectAllocation = NO;
{ {
static NSArray *runLoopModes = nil; static NSArray *runLoopModes = nil;
WOResponse *resp; WOResponse *resp;
NSDate *startDate, *endDate;
if (debugRequests)
{
[self logWithFormat: @"starting method '%@' on uri '%@'",
[_request method], [_request uri]];
startDate = [NSDate date];
}
cache = [SOGoCache sharedCache]; cache = [SOGoCache sharedCache];
resp = [super dispatchRequest: _request]; resp = [super dispatchRequest: _request];
[SOGoCache killCache]; [SOGoCache killCache];
if (debugRequests)
{
endDate = [NSDate date];
[self logWithFormat: @"request took %f seconds to execute",
[endDate timeIntervalSinceDate: startDate]];
}
if (![self isTerminating]) if (![self isTerminating])
{ {
if (!runLoopModes) if (!runLoopModes)