Hi all,
I have a usecase wherein I want to make scheduling decisions off of the sidekiq processes and the workers(threads ) in each of them. The way I'm doing it (from elixir code) is:
{:ok, workers} = Mozek.Redis.command(["SMEMBERS", "processes"])
Enum.reduce(workers, 0, fn worker, acc ->
{_, payload} = Mozek.Redis.command(["HGETALL", "#{worker}:workers"])
acc + div(length(payload), 2)
end)
This is working fine as long as workers are working but is not useful if workers are idle in which case the first and second queries don't give the expected result. Can someone point out what am I doing wrong or what else can I do to get the same results?
Thanks and regards,
Pranav Dubey