returns number of queries in log
| 99 | |
| 100 | // returns number of queries in log |
| 101 | uint64_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 |
no test coverage detected