]> err.no Git - sope/blob - sope-appserver/NGObjWeb/NGObjWeb/WOStatisticsStore.h
major improvements in resource/template lookup with SoProduct's
[sope] / sope-appserver / NGObjWeb / NGObjWeb / WOStatisticsStore.h
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __NGObjWeb_WOStatisticsStore_H__
23 #define __NGObjWeb_WOStatisticsStore_H__
24
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSLock.h>
27 #import <Foundation/NSDate.h>
28
29 @class NSString, NSDictionary, NSMutableDictionary;
30 @class WOResponse, WOContext;
31
32 @interface WOStatisticsStore : NSObject < NSLocking >
33 {
34   id<NSLocking,NSObject> lock;
35   NSDate   *startTime;
36   
37   NSMutableDictionary *pageStatistics;
38   unsigned       totalResponseCount;
39   unsigned       pageResponseCount;
40   unsigned       totalResponseSize;
41   unsigned       zippedResponsesCount;
42   unsigned       totalZippedSize;
43   int            smallestResponseSize;
44   unsigned       largestResponseSize;
45   NSTimeInterval minimumDuration;
46   NSTimeInterval maximumDuration;
47   NSTimeInterval totalDuration;
48 }
49
50 /* query */
51
52 - (NSDictionary *)statistics;
53
54 /* recording */
55
56 - (void)recordStatisticsForResponse:(WOResponse *)_response
57   inContext:(WOContext *)_context;
58
59 - (NSString *)descriptionForResponse:(WOResponse *)_response
60   inContext:(WOContext *)_context;
61
62 /* formatting */
63
64 - (NSString *)formatDescription:(NSString *)_description
65   forResponse:(WOResponse *)_response
66   inContext:(WOContext *)_context;
67
68 /* NSLocking */
69
70 - (void)lock;
71 - (void)unlock;
72
73 @end
74
75 #endif /* __NGObjWeb_WOStatisticsStore_H__ */