You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1localfunctionbuild_stats(space)
2localstats= {tasks= {}, calls= {
3ack=0, bury=0, delete=0,
4kick=0, put=0, release=0,
5take=0, touch=0,
6-- for *ttl queues only7ttl=0, ttr=0, delay=0,
8 }}
910localst=rawget(queue.stat, space) or {}
11localidx_tube=11213-- add api calls stats14forname, valueinpairs(st) do15iftype(value) ~='function' andname~='done' then16stats['calls'][name] =value17end18end1920-- add total tasks count21stats['tasks']['total'] =box.space[space].index[idx_tube]:count()
2223-- add tasks by state count24fori, sinpairs(state) do25stats['tasks'][i:lower()] =box.space[space].index[idx_tube]:count(s)
26end27stats['tasks']['done'] =st.doneor02829returnstats30end
This function calls count() 6 times on each queue.statistics(). This could be a reason of very aggressive CPU usage if there are very many tasks in the queue.
The text was updated successfully, but these errors were encountered:
This function calls
count()
6 times on eachqueue.statistics()
. This could be a reason of very aggressive CPU usage if there are very many tasks in the queue.The text was updated successfully, but these errors were encountered: