Go to the documentation of this file.
25 #ifndef SURICATA_COUNTERS_H
26 #define SURICATA_COUNTERS_H
141 #ifdef BUILD_UNIX_SOCKET
142 TmEcode StatsOutputCounterSocket(json_t *cmd,
143 json_t *answer,
void *data);
void StatsSetupPostConfigPostOutput(void)
void StatsIncr(struct ThreadVars_ *, uint16_t)
Increments the local counter.
SC_ATOMIC_DECLARE(bool, sync_now)
void StatsSyncCountersIfSignalled(struct ThreadVars_ *tv)
uint64_t StatsGetLocalCounterValue(struct ThreadVars_ *, uint16_t)
Get the value of the local copy of the counter that hold this id.
Container to hold the counter variable.
void StatsSetupPostConfigPreOutput(void)
void StatsRegisterTests(void)
struct StatsCounter_ StatsCounter
Container to hold the counter variable.
struct StatsPrivateThreadContext_ StatsPrivateThreadContext
used to hold the private version of the counters registered
int StatsUpdateCounterArray(StatsPrivateThreadContext *, StatsPublicThreadContext *)
the private stats store with the public stats store
void StatsDecr(struct ThreadVars_ *, uint16_t)
Decrements the local counter.
struct StatsCounter_ * next
Per thread variable structure.
void StatsSyncCounters(struct ThreadVars_ *tv)
Stats Context for a ThreadVars instance.
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 StatsAddUI64(struct ThreadVars_ *, uint16_t, uint64_t)
Adds a value of type uint64_t to the local counter.
uint16_t StatsRegisterGlobalCounter(const char *cname, uint64_t(*Func)(void))
Registers a counter, which represents a global value.
used to hold the private version of the counters registered
Storage for local counters, with a link to the public counter used for syncs.
int StatsSetupPrivate(struct ThreadVars_ *)
struct StatsPublicThreadContext_ StatsPublicThreadContext
Stats Context for a ThreadVars instance.
uint16_t StatsRegisterAvgCounter(const char *, struct ThreadVars_ *)
Registers a counter, whose value holds the average of all the values assigned to it.
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...
void StatsThreadCleanup(struct ThreadVars_ *)
void StatsSpawnThreads(void)
Spawns the wakeup, and the management thread used by the stats api.
uint16_t StatsRegisterMaxCounter(const char *, struct ThreadVars_ *)
Registers a counter, whose value holds the maximum of all the values assigned to it.
void StatsReleaseResources(void)
Releases the resources allotted by the Stats API.