25#ifndef SURICATA_COUNTERS_H
26#define SURICATA_COUNTERS_H
141#ifdef BUILD_UNIX_SOCKET
142TmEcode StatsOutputCounterSocket(json_t *cmd,
143 json_t *answer,
void *data);
void StatsSyncCounters(struct ThreadVars_ *tv)
void StatsSetUI64(struct ThreadVars_ *, uint16_t, uint64_t)
Sets a value of type double to the local counter.
uint16_t StatsRegisterCounter(const char *, struct ThreadVars_ *)
Registers a normal, unqualified counter.
void StatsSpawnThreads(void)
Spawns the wakeup, and the management thread used by the stats api.
void StatsDecr(struct ThreadVars_ *, uint16_t)
Decrements the local counter.
void StatsAddUI64(struct ThreadVars_ *, uint16_t, uint64_t)
Adds a value of type uint64_t to the local counter.
uint16_t StatsRegisterMaxCounter(const char *, struct ThreadVars_ *)
Registers a counter, whose value holds the maximum of all the values assigned to it.
void StatsThreadCleanup(struct ThreadVars_ *)
int StatsUpdateCounterArray(StatsPrivateThreadContext *, StatsPublicThreadContext *)
the private stats store with the public stats store
struct StatsLocalCounter_ StatsLocalCounter
Storage for local counters, with a link to the public counter used for syncs.
void StatsInit(void)
Initializes the perf counter api. Things are hard coded currently. More work to be done when we imple...
struct StatsPublicThreadContext_ StatsPublicThreadContext
Stats Context for a ThreadVars instance.
uint64_t StatsGetLocalCounterValue(struct ThreadVars_ *, uint16_t)
Get the value of the local copy of the counter that hold this id.
void StatsIncr(struct ThreadVars_ *, uint16_t)
Increments the local counter.
uint16_t StatsRegisterAvgCounter(const char *, struct ThreadVars_ *)
Registers a counter, whose value holds the average of all the values assigned to it.
struct StatsPrivateThreadContext_ StatsPrivateThreadContext
used to hold the private version of the counters registered
int StatsSetupPrivate(struct ThreadVars_ *)
uint16_t StatsRegisterGlobalCounter(const char *cname, uint64_t(*Func)(void))
Registers a counter, which represents a global value.
struct StatsCounter_ StatsCounter
Container to hold the counter variable.
void StatsSetupPostConfigPostOutput(void)
void StatsReleaseResources(void)
Releases the resources allotted by the Stats API.
void StatsSyncCountersIfSignalled(struct ThreadVars_ *tv)
void StatsSetupPostConfigPreOutput(void)
void StatsRegisterTests(void)
Container to hold the counter variable.
struct StatsCounter_ * next
Storage for local counters, with a link to the public counter used for syncs.
used to hold the private version of the counters registered
Stats Context for a ThreadVars instance.
SC_ATOMIC_DECLARE(bool, sync_now)
Per thread variable structure.