/[resiprocate]/branches/b-directory-reorg/sip/resiprocate/StatisticsMessage.hxx
ViewVC logotype

Contents of /branches/b-directory-reorg/sip/resiprocate/StatisticsMessage.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5271 - (show annotations) (download)
Thu Aug 18 23:43:07 2005 UTC (14 years, 3 months ago) by jason
File size: 5617 byte(s)
new directory reorg proposal
1 #ifndef RESIP_StatisticsMessage_hxx
2 #define RESIP_StatisticsMessage_hxx
3
4 #include <iostream>
5 #include "resiprocate/ApplicationMessage.hxx"
6 #include "resiprocate/MethodTypes.hxx"
7 #include "resiprocate/os/Mutex.hxx"
8 #include "resiprocate/os/HeapInstanceCounter.hxx"
9
10 namespace resip
11 {
12 class Subsystem;
13
14 class StatisticsMessage : public ApplicationMessage
15 {
16 public:
17 RESIP_HeapCount(StatisticsMessage);
18 class AtomicPayload;
19 StatisticsMessage(const AtomicPayload& payload);
20 StatisticsMessage(const StatisticsMessage& rhs);
21
22 virtual ~StatisticsMessage();
23
24 struct Payload
25 {
26 enum {MaxCode = 700};
27
28 Payload();
29
30 unsigned int tuFifoSize;
31 unsigned int transportFifoSizeSum;
32 unsigned int transactionFifoSize;
33 unsigned int activeTimers;
34 unsigned int openTcpConnections; // .dlb. not implemented
35 unsigned int activeClientTransactions; // .dlb. not implemented
36 unsigned int activeServerTransactions; // .dlb. not implemented
37 unsigned int pendingDnsQueries; // .dlb. not implemented
38
39 unsigned int requestsSent; // includes retransmissions
40 unsigned int responsesSent; // includes retransmissions
41 unsigned int requestsRetransmitted; // counts each retransmission
42 unsigned int responsesRetransmitted; // counts each retransmission
43 unsigned int requestsReceived;
44 unsigned int responsesReceived;
45
46 unsigned int responsesByCode[MaxCode];
47
48 unsigned int requestsSentByMethod[MAX_METHODS];
49 unsigned int requestsRetransmittedByMethod[MAX_METHODS];
50 unsigned int requestsReceivedByMethod[MAX_METHODS];
51 unsigned int responsesSentByMethod[MAX_METHODS];
52 unsigned int responsesRetransmittedByMethod[MAX_METHODS];
53 unsigned int responsesReceivedByMethod[MAX_METHODS];
54
55 unsigned int responsesSentByMethodByCode[MAX_METHODS][MaxCode];
56 unsigned int responsesRetransmittedByMethodByCode[MAX_METHODS][MaxCode];
57 unsigned int responsesReceivedByMethodByCode[MAX_METHODS][MaxCode];
58
59 unsigned int sum2xxIn(MethodTypes method) const;
60 unsigned int sumErrIn(MethodTypes method) const;
61 unsigned int sum2xxOut(MethodTypes method) const;
62 unsigned int sumErrOut(MethodTypes method) const;
63
64 Payload& operator=(const Payload& payload);
65 };
66
67 void loadOut(Payload& payload) const;
68 static void logStats(const Subsystem& subsystem, const Payload& stats);
69
70
71 virtual std::ostream& encode(std::ostream& strm) const;
72 virtual std::ostream& encodeBrief(std::ostream& str) const;
73
74 Message* clone() const;
75
76 class AtomicPayload : private Payload
77 {
78 public:
79 AtomicPayload();
80 void loadIn(const Payload& payload);
81 void loadOut(Payload& payload) const;
82 private:
83 mutable Mutex mMutex;
84
85 AtomicPayload(const AtomicPayload&);
86 AtomicPayload& operator=(const AtomicPayload&);
87 };
88
89 private:
90 const AtomicPayload& mPayload;
91 };
92
93 }
94
95 #endif
96
97 /* ====================================================================
98 * The Vovida Software License, Version 1.0
99 *
100 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
101 *
102 * Redistribution and use in source and binary forms, with or without
103 * modification, are permitted provided that the following conditions
104 * are met:
105 *
106 * 1. Redistributions of source code must retain the above copyright
107 * notice, this list of conditions and the following disclaimer.
108 *
109 * 2. Redistributions in binary form must reproduce the above copyright
110 * notice, this list of conditions and the following disclaimer in
111 * the documentation and/or other materials provided with the
112 * distribution.
113 *
114 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
115 * and "Vovida Open Communication Application Library (VOCAL)" must
116 * not be used to endorse or promote products derived from this
117 * software without prior written permission. For written
118 * permission, please contact vocal@vovida.org.
119 *
120 * 4. Products derived from this software may not be called "VOCAL", nor
121 * may "VOCAL" appear in their name, without prior written
122 * permission of Vovida Networks, Inc.
123 *
124 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
125 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
126 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
127 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
128 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
129 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
130 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
131 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
132 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
133 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
134 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
135 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
136 * DAMAGE.
137 *
138 * ====================================================================
139 *
140 * This software consists of voluntary contributions made by Vovida
141 * Networks, Inc. and many individuals on behalf of Vovida Networks,
142 * Inc. For more information on Vovida Networks, Inc., please see
143 * <http://www.vovida.org/>.
144 *
145 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27