diff --git a/ChangeLog b/ChangeLog index 8b878d416..2c3b5eb61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-05-18 Wolfgang Sourdeau + + * Main/SOGo.m (-dispatchRequest:): send a "SOGoRequestDuration" + header back to the client with the time delta as value when + SOGoDebugRequests is set to YES. + 2010-05-17 Wolfgang Sourdeau * UI/WebServerResources/UIxAttendeesEditor.js diff --git a/Main/SOGo.m b/Main/SOGo.m index 7b175a1d1..c4095e3eb 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -388,7 +388,8 @@ static BOOL debugLeaks; static NSArray *runLoopModes = nil; static BOOL debugOn = NO; WOResponse *resp; - NSDate *startDate, *endDate; + NSDate *startDate; + NSTimeInterval timeDelta; if (debugRequests) { @@ -416,9 +417,12 @@ static BOOL debugLeaks; if (debugRequests) { - endDate = [NSDate date]; - [self logWithFormat: @"request took %f seconds to execute", - [endDate timeIntervalSinceDate: startDate]]; + timeDelta = [[NSDate date] timeIntervalSinceDate: startDate]; + [self logWithFormat: [NSString stringWithFormat: + @"request took %f seconds to execute", + timeDelta]]; + [resp setHeader: [NSString stringWithFormat: @"%f", timeDelta] + forKey: @"SOGoRequestDuration"]; } if (![self isTerminating])