Go to the documentation of this file.
25 #ifndef SURICATA_COUNTERS_H
26 #define SURICATA_COUNTERS_H
156 #ifdef BUILD_UNIX_SOCKET
157 TmEcode StatsOutputCounterSocket(json_t *cmd,
158 json_t *answer,
void *data);
void StatsSetupPostConfigPostOutput(void)
SC_ATOMIC_DECLARE(bool, sync_now)
void StatsCounterIncr(StatsThreadContext *, StatsCounterId)
Increments the local counter.
struct StatsCounterGlobalId StatsCounterGlobalId
void StatsSyncCounters(StatsThreadContext *)
StatsCounterAvgId StatsRegisterAvgCounter(const char *, StatsThreadContext *)
Registers a counter, whose value holds the average of all the values assigned to it.
Container to hold the counter variable.
void StatsSetupPostConfigPreOutput(void)
struct StatsCounterMaxId StatsCounterMaxId
StatsLocalCounter * copy_of_private
void StatsRegisterTests(void)
StatsCounterGlobalId StatsRegisterGlobalCounter(const char *cname, uint64_t(*Func)(void))
Registers a counter, which represents a global value.
struct StatsThreadContext_ StatsThreadContext
struct StatsCounter_ StatsCounter
Container to hold the counter variable.
struct StatsPrivateThreadContext_ StatsPrivateThreadContext
used to hold the private version of the counters registered
StatsCounterId StatsRegisterCounter(const char *, StatsThreadContext *)
Registers a normal, unqualified counter.
struct StatsCounter_ * next
StatsCounterMaxId StatsRegisterMaxCounter(const char *, StatsThreadContext *)
Registers a counter, whose value holds the maximum of all the values assigned to it.
StatsPublicThreadContext pub
struct StatsCounterAvgId StatsCounterAvgId
int StatsSetupPrivate(StatsThreadContext *, const char *)
Stats Context for a ThreadVars instance.
int64_t StatsCounterGetLocalValue(StatsThreadContext *, StatsCounterId)
Get the value of the local copy of the counter that hold this id.
void StatsCounterAddI64(StatsThreadContext *, StatsCounterId, int64_t)
Adds a value of type uint64_t to the local counter.
void StatsThreadCleanup(StatsThreadContext *)
void StatsCounterAvgAddI64(StatsThreadContext *, StatsCounterAvgId id, int64_t x)
used to hold the private version of the counters registered
counter type for local (private) increments. For AVG counters we use 2 to track values and updates.
void StatsSyncCountersIfSignalled(StatsThreadContext *)
const StatsCounter ** pc_array
struct StatsPublicThreadContext_ StatsPublicThreadContext
Stats Context for a ThreadVars instance.
struct StatsLocalCounter_ StatsLocalCounter
counter type for local (private) increments. For AVG counters we use 2 to track values and updates.
void StatsCounterMaxUpdateI64(StatsThreadContext *, StatsCounterMaxId id, int64_t x)
update the value of the localmax counter
void StatsInit(void)
Initializes the perf counter api. Things are hard coded currently. More work to be done when we imple...
void StatsCounterSetI64(StatsThreadContext *, StatsCounterId, int64_t)
set, so overwrite, the value of the local counter
void StatsThreadInit(StatsThreadContext *)
void StatsSpawnThreads(void)
Spawns the wakeup, and the management thread used by the stats api.
StatsPrivateThreadContext priv
void StatsReleaseResources(void)
Releases the resources allotted by the Stats API.
void StatsCounterDecr(StatsThreadContext *, StatsCounterId)
Decrements the local counter.
struct StatsCounterId StatsCounterId