OpenMAMA
stat.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamaStatsH__
23 #define MamaStatsH__
24 
25 #include "mama/status.h"
26 
27 #if defined(__cplusplus)
28 extern "C" {
29 #endif
30 
31 #define MAMA_STAT_NOT_LOCKABLE 0
32 #define MAMA_STAT_LOCKABLE 1
33 
34 typedef enum mamaStatType
35 {
65 
71 MAMAExpDLL
72 extern mama_status
73 mamaStat_create (mamaStat* stat, mamaStatsCollector collector, int lockable, const char* name, mama_fid_t type);
74 
80 MAMAExpDLL
81 extern mama_status
83 
89 MAMAExpDLL
90 extern mama_status
92 
98 MAMAExpDLL
99 extern mama_status
101 
107 MAMAExpDLL
108 extern mama_status
109 mamaStat_reset (mamaStat stat);
116 MAMAExpDLL
117 extern mama_status
118 mamaStat_add (mamaStat stat, int value);
119 
126 MAMAExpDLL
127 extern mama_status
128 mamaStat_subtract (mamaStat stat, int value);
129 
136 MAMAExpDLL
137 extern mama_status
138 mamaStat_setIntervalValue (mamaStat stat, int value);
139 
147 MAMAExpDLL
148 extern mama_fid_t
150 
158 MAMAExpDLL
159 extern int
161 
168 MAMAExpDLL
169 extern int
171 
178 MAMAExpDLL
179 extern int
181 
198 MAMAExpDLL
199 extern void
200 mamaStat_getStats (mamaStat stat, mama_i32_t* intervalValue, mama_u32_t* maxValue, mama_u32_t* totalValue);
201 
207 MAMAExpDLL
208 extern const char*
210 
217 MAMAExpDLL
218 extern mama_status
219 mamaStat_setLog (mamaStat stat, int log);
220 
227 MAMAExpDLL
228 extern int
230 
237 MAMAExpDLL
238 extern mama_status
239 mamaStat_setPublish (mamaStat stat, int publish);
240 
247 MAMAExpDLL
248 extern int
250 
256 MAMAExpDLL
257 extern mamaStatType
258 mamaStatType_fromString (const char* statTypeString);
259 
265 MAMAExpDLL
266 extern const char*
268 
269 #if defined(__cplusplus)
270 }
271 #endif
272 
273 #endif /* MamaStatsH__ */
MAMAExpDLL int mamaStat_getIntervalValue(mamaStat stat)
Get the value of the stat for the current interval.
Definition: stat.h:38
Definition: stat.h:57
Definition: stat.h:48
Definition: stat.h:44
struct mamaStatImpl_ * mamaStat
Definition: types.h:124
MAMAExpDLL mama_status mamaStat_create(mamaStat *stat, mamaStatsCollector collector, int lockable, const char *name, mama_fid_t type)
Create a mamaStats object.
Definition: stat.h:50
MAMAExpDLL mama_status mamaStat_setPublish(mamaStat stat, int publish)
Set whether or not to publish this stat.
Definition: stat.h:56
Definition: stat.h:40
MAMAExpDLL mama_status mamaStat_subtract(mamaStat stat, int value)
Subtract the stats object counter with the value.
Definition: stat.h:49
Definition: stat.h:42
MAMAExpDLL int mamaStat_getMaxValue(mamaStat stat)
Get the maximum value of the stat.
Definition: stat.h:51
Definition: stat.h:59
MAMAExpDLL mama_status mamaStat_add(mamaStat stat, int value)
Adds the stats object counter with the value.
Definition: stat.h:63
Definition: stat.h:39
MAMAExpDLL mama_status mamaStat_decrement(mamaStat stat)
Decrement the stats object counter.
Definition: stat.h:45
MAMAExpDLL const char * mamaStat_getName(mamaStat stat)
Get the name of the stat.
Definition: stat.h:37
struct mamaStatsCollectorImpl_ * mamaStatsCollector
Definition: types.h:125
uint16_t mama_fid_t
Definition: types.h:46
Definition: stat.h:46
MAMAExpDLL mamaStatType mamaStatType_fromString(const char *statTypeString)
Returns a mamaStatType from a string.
MAMAExpDLL int mamaStat_getPublish(mamaStat stat)
Returns whether or not the stat is currently being published.
MAMAExpDLL mama_status mamaStat_increment(mamaStat stat)
Increment the stats object counter.
MAMAExpDLL mama_status mamaStat_destroy(mamaStat stat)
Destroy a mamaStats object.
MAMAExpDLL mama_status mamaStat_setLog(mamaStat stat, int log)
Set whether or not this stat should be logged in the MAMA log.
Definition: stat.h:47
MAMAExpDLL int mamaStat_getTotalValue(mamaStat stat)
Get the total value of the stat.
Definition: stat.h:60
mama_status
Definition: status.h:37
uint32_t mama_u32_t
Definition: types.h:39
MAMAExpDLL mama_status mamaStat_setIntervalValue(mamaStat stat, int value)
set the Interval value
Definition: stat.h:43
MAMAExpDLL int mamaStat_getLog(mamaStat stat)
Returns whether or not the stat is currently being logged to the MAMA log.
Definition: stat.h:41
Definition: stat.h:36
MAMAExpDLL void mamaStat_getStats(mamaStat stat, mama_i32_t *intervalValue, mama_u32_t *maxValue, mama_u32_t *totalValue)
Get the interval, maximum, and total values for the stat.
Definition: stat.h:58
int32_t mama_i32_t
Definition: types.h:38
mamaStatType
Definition: stat.h:34
MAMAExpDLL mama_status mamaStat_reset(mamaStat stat)
Reset the stats object counter.
MAMAExpDLL const char * mamaStatType_toString(mamaStatType statType)
Returns a string representation of a mamaStatType.
MAMAExpDLL mama_fid_t mamaStat_getFid(mamaStat stat)
Get the FID used when publishing the stat via the stats logger.


© 2012 Linux Foundation