logging: Implement get_delay_queue_size()

Primarily for introspection given that re-delaying may exceed
queue sizes.
This commit is contained in:
Arne Welzel 2023-11-23 21:09:41 +01:00
parent f0e67022fd
commit 2dbb467ba2
8 changed files with 213 additions and 0 deletions

View file

@ -719,6 +719,13 @@ export {
##
## Returns: ``T`` on success, else ``F``.
global set_max_delay_queue_size: function(id: Log::ID, queue_size: count): bool;
## Get the current size of the delay queue for a stream.
##
## id: The ID associated with a logging stream.
##
## Returns: The current size of the delay queue, or -1 on error.
global get_delay_queue_size: function(id: Log::ID): int;
}
global all_streams: table[ID] of Stream = table();
@ -1066,3 +1073,8 @@ function set_max_delay_queue_size(id: Log::ID, max_size: count): bool
return T;
}
function get_delay_queue_size(id: Log::ID): int
{
return Log::__get_delay_queue_size(id);
}