This file is indexed.

/usr/include/wombat/wMessageStats.h is in libmama-dev 2.2.2.1-11.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/* $Id$
 *
 * OpenMAMA: The open middleware agnostic messaging API
 * Copyright (C) 2011 NYSE Technologies, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#ifndef _PERF_DATA_H__
#define _PERF_DATA_H__

#if defined(__cplusplus)
    extern "C" {
#endif /* __cplusplus */

#include "machine.h"
#include <stdio.h>
#ifndef WIN32
#include <sys/time.h>
#endif

#ifdef WIN32

#include <winsock2.h>

#endif

/*******************************************************************************
*******************************************************************************/


struct perfData_t;
typedef struct perfData_t perfData;

struct statsCache_t;
typedef struct statsCache_t statsCache;

struct processInfo_t;
typedef struct processInfo_t processInfo;
 
typedef struct latencyVals
{
    double pubTimeMilliSecs;     /*time msg was published in milliseconds*/
    double recieveTimeMilliSecs; /*time msg was recieved in milliseconds*/
    double latencyMilliSecs;     /*latency between two previous vals*/
}latencyVals;

typedef struct performanceData
{
    const char* mSymbol;
    double mTotalTime;
    long   mMsgCountP;
    double mMsgPerSecP;
    long   mByteCountP;
    double mBytePerSecP;
    double mMinLatencyP;
    double mMaxLatencyP;
    double mAveLatencyP;
    double mStdDeviationP;
}performanceData;

enum
{
    STATS_OK                =   0,
    STATS_FAILURE_GENERAL   =  -1,
    STATS_NULL_PARAM        =   1,
    STATS_NO_MEMORY         =   2
};

/* used to create instance of struct to hold stats data
** @param statsCache        -- caches relevant statistics data
**
** @param numMsgCategories  -- 0 if stats for all symbols needed or number of
**                             symbols if stats are needed on per symbol basis
**
** @param outfile           -- where stats are to be displayed
**
** @param header            -- 1 to display header 0 for never
**
** returns STATS_NO_MEMORY or STATS_OK
*/
COMMONExpDLL
int createStatisticsCache(statsCache** sCache,
                            int numMsgCategories, 
                            FILE* outfile,
                            int header); 



/* used to gather stats at user specified intervals */
/*@param myPerformanceData  -- if user wants results in performanceData 
**                             structure pass in pointer to it, pass in null if
**                             not, wMessageStats.c will then print results to 
**                             FILE* outfile that was passed in on creation of 
**                             statsCache.
*/
COMMONExpDLL
void statisticsCacheToFile(statsCache* sCache,
                           performanceData* myPerformanceData);



/* stores stats for individual symbols and counts 
** messages and bytes between intervals
** @param msgCategoryName   -- name by which message or symbol
**                             is to be identified
** @param numBytesRecieved  -- size of message in Bytes
** @param timeSecs          -- time in secs from epoch until now
** @param timeMicroSecs     -- time in micro seconds from last second
** @param cLatency          -- if latency is already known pass it in,
**                             set timeSecs + timeMicroSecs = 0
** @param tv                -- time on which latency will be calculated
**                             i.e time message was recieved.
*/
COMMONExpDLL
int updateStatisticsCache(statsCache* sCache,
                          const char* msgCategoryName,
                                long  numBytesRecieved,
                                long  timeSecs,
                                long  timeMicroSecs,
                              double  cLatency,
                              struct  timeval tv);

COMMONExpDLL
void destroyStatsCache(statsCache*);

/* prints end of test report to file */
COMMONExpDLL
int printPerfReport(statsCache* sCache, FILE*);



/* function calculates latency between timeSecs,timeMicroSecs 
** and time of calling function. returns latencyVals structure.
** @param timeSecs      -- time in seconds since the epoch 
** @param timeMicroSecs -- time past the last second in micro seconds
** @param latency       -- puts latency value in double* latencyi
** @param tv            -- time on which latency will be calculated
**                         i.e time message was recieved.
*/
COMMONExpDLL
latencyVals calcLatency(long   timeSecs,
                        long   timeMicroSecs,
                     double*   latency,
              struct timeval   tv);


/* function calculates latency on timestamp and puts result in double* latency
** @param timeStamp     -- timestamp string
** @param timeFormat    -- format of timeStamp string ie "%d:%m:%Y:%H:%M:%S"
** @param latency       -- poiner to double where latency value
**                         is to be stored
** @param tv            -- time on which latency will be calculated
**                         i.e time message was recieved.
*/
COMMONExpDLL
latencyVals calcLatency1TimeStamp(const char* timeStamp,
                                  const char* timeFormat,
                                      double* latency,
                               struct timeval tv);

/* Function to print statsLevel 1 values 
** @param timeSecs      -- time in seconds since the epoch
** @param timeMicroSecs -- time past the last second in micro seconds
** @param numMsg        -- when using statsLevel 1, numMsg defines how often to
**                         calculate results.
** @graphData           -- where you want data to be displayed ie
**                         stdout or specify a directory /home/username/
*/


COMMONExpDLL
void printStatsLevel1(int numMsg, FILE* graphData);
/* function prints out to graphData:
** if out to screen
** |Global Count|Total Time|CPU utime|CPU stime|CPU%|Ave CPU%|Memory|Memory%|
** 
** if out to file Ave CPU% is left out
*/

/* function starts timer for cpu ticks which is used by getCpuTimeVals
** startCpuTime should be started before using getCpuTimeVals()
**
*/
COMMONExpDLL
void startCpuTimer(void);
COMMONExpDLL
void getCpuTimeVals(cpuVals *cpuV, int isUpdate);
COMMONExpDLL
void getCpuTimeValDiff(cpuVals cpuV1,cpuVals cpuV2,cpuVals* cpuV); 
/* function returns memory statistics */
/*void getMemVals( int pid,memVals *memV);*/

#if defined(__cplusplus)
}
#endif /* __cplusplus */
#endif /*_PERF_DATA_H__*/