MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / QueriesLog_GetQueriesCount

Function QueriesLog_GetQueriesCount

src/queries_log/queries_log.c:101–116  ·  view source on GitHub ↗

returns number of queries in log

Source from the content-addressed store, hash-verified

99
100// returns number of queries in log
101uint64_t QueriesLog_GetQueriesCount
102(
103 QueriesLog log // queries log
104) {
105 // acquire READ lock to buffer
106 pthread_rwlock_rdlock(&log->rwlock);
107
108 // there's no harm in returning a lower count than actual
109 // inf favour of performance
110 uint64_t n = CircularBuffer_ItemCount(log->queries);
111
112 // release lock
113 pthread_rwlock_unlock(&log->rwlock);
114
115 return n;
116}
117
118// reset queries buffer
119// returns queries buffer prior to reset

Callers 1

Calls 1

CircularBuffer_ItemCountFunction · 0.85

Tested by

no test coverage detected