char *tm_name;
- SCPerfPublicContext *ctx;
+ StatsPublicThreadContext *ctx;
- SCPerfPublicContext **head;
+ StatsPublicThreadContext **head;
uint32_t size;
struct StatsThreadStore_ *next;
HashTable *counters_id_hash;
- SCPerfPublicContext global_counter_ctx;
+ StatsPublicThreadContext global_counter_ctx;
} StatsGlobalContext;
static void *stats_thread_data = NULL;
static char stats_enabled = TRUE;
static int StatsOutput(ThreadVars *tv);
-static int StatsThreadRegister(const char *thread_name, SCPerfPublicContext *);
+static int StatsThreadRegister(const char *thread_name, StatsPublicThreadContext *);
/** stats table is filled each interval and passed to the
* loggers. Initialized at first use. */
/**
* \brief Wake up thread. This thread wakes up every TTS(time to sleep) seconds
- * and sets the flag for every ThreadVars' SCPerfPublicContext
+ * and sets the flag for every ThreadVars' StatsPublicThreadContext
*
* \param arg is NULL always
*
*
* \param cname Name of the counter, to be registered
* \param tm_name Thread module to which this counter belongs
- * \param pctx SCPerfPublicContext for this tm-tv instance
+ * \param pctx StatsPublicThreadContext for this tm-tv instance
* \param type_q Qualifier describing the type of counter to be registered
*
* \retval the counter id for the newly registered counter, or the already
* \retval 0 on failure
*/
static uint16_t StatsRegisterQualifiedCounter(char *cname, char *tm_name,
- SCPerfPublicContext *pctx,
+ StatsPublicThreadContext *pctx,
int type_q, uint64_t (*Func)(void))
{
SCPerfCounter **head = &pctx->head;
SCPerfCounter *pc = NULL;
if (cname == NULL || pctx == NULL) {
- SCLogDebug("Counter name, SCPerfPublicContext NULL");
+ SCLogDebug("Counter name, StatsPublicThreadContext NULL");
return 0;
}
* are stacked together in a PCTMI container.
*
* \param tm_name Name of the tm to be added to the table
- * \param pctx SCPerfPublicContext associated with the TM tm_name
+ * \param pctx StatsPublicThreadContext associated with the TM tm_name
*
* \retval 1 on success, 0 on failure
*/
-static int StatsThreadRegister(const char *thread_name, SCPerfPublicContext *pctx)
+static int StatsThreadRegister(const char *thread_name, StatsPublicThreadContext *pctx)
{
if (stats_ctx == NULL) {
SCLogDebug("Counter module has been disabled");
*
* \param s_id Counter id of the first counter to be added to the array
* \param e_id Counter id of the last counter to be added to the array
- * \param pctx Pointer to the tv's SCPerfPublicContext
+ * \param pctx Pointer to the tv's StatsPublicThreadContext
*
* \retval a counter-array in this(s_id-e_id) range for this TM instance
*/
static int SCPerfGetCounterArrayRange(uint16_t s_id, uint16_t e_id,
- SCPerfPublicContext *pctx,
+ StatsPublicThreadContext *pctx,
SCPerfPrivateContext *pca)
{
SCPerfCounter *pc = NULL;
* \brief Returns a counter array for all counters registered for this tm
* instance
*
- * \param pctx Pointer to the tv's SCPerfPublicContext
+ * \param pctx Pointer to the tv's StatsPublicThreadContext
*
* \retval pca Pointer to a counter-array for all counter of this tm instance
* on success; NULL on failure
*/
-static int SCPerfGetAllCountersArray(SCPerfPublicContext *pctx, SCPerfPrivateContext *private)
+static int SCPerfGetAllCountersArray(StatsPublicThreadContext *pctx, SCPerfPrivateContext *private)
{
if (pctx == NULL || private == NULL)
return -1;
* \brief Syncs the counter array with the global counter variables
*
* \param pca Pointer to the SCPerfPrivateContext
- * \param pctx Pointer the the tv's SCPerfPublicContext
+ * \param pctx Pointer the the tv's StatsPublicThreadContext
*
* \retval 0 on success
* \retval -1 on error
*/
-int SCPerfUpdateCounterArray(SCPerfPrivateContext *pca, SCPerfPublicContext *pctx)
+int SCPerfUpdateCounterArray(SCPerfPrivateContext *pca, StatsPublicThreadContext *pctx)
{
SCPCAElem *pcae = NULL;
uint32_t i = 0;
* \param tm_name Name of the engine module under which the counter has to be
* registered
* \param type Datatype of this counter variable
- * \param pctx SCPerfPublicContext corresponding to the tm_name key under which the
+ * \param pctx StatsPublicThreadContext corresponding to the tm_name key under which the
* key has to be registered
*
* \retval id Counter id for the newly registered counter, or the already
* present counter
*/
static uint16_t RegisterCounter(char *cname, char *tm_name,
- SCPerfPublicContext *pctx)
+ StatsPublicThreadContext *pctx)
{
uint16_t id = StatsRegisterQualifiedCounter(cname, tm_name, pctx,
STATS_TYPE_NORMAL, NULL);
static int SCPerfTestCounterReg02()
{
- SCPerfPublicContext pctx;
+ StatsPublicThreadContext pctx;
- memset(&pctx, 0, sizeof(SCPerfPublicContext));
+ memset(&pctx, 0, sizeof(StatsPublicThreadContext));
return RegisterCounter(NULL, NULL, &pctx);
}
static int SCPerfTestCounterReg03()
{
- SCPerfPublicContext pctx;
+ StatsPublicThreadContext pctx;
int result;
- memset(&pctx, 0, sizeof(SCPerfPublicContext));
+ memset(&pctx, 0, sizeof(StatsPublicThreadContext));
result = RegisterCounter("t1", "c1", &pctx);
static int SCPerfTestCounterReg04()
{
- SCPerfPublicContext pctx;
+ StatsPublicThreadContext pctx;
int result;
- memset(&pctx, 0, sizeof(SCPerfPublicContext));
+ memset(&pctx, 0, sizeof(StatsPublicThreadContext));
RegisterCounter("t1", "c1", &pctx);
RegisterCounter("t2", "c2", &pctx);