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
But Lua has hash tables, and with them we can search with O(1) at most times (and it's not like hash collision will happen often with standard number of collectors). All we need is to use kind+name key instead of plain array, i.e.
{ [ kind1..name1] =collector1, ... }
instead of
{ [1] =collector1 }
since kind+name must be unique. Moreover, it is more common to search for user collectors, but in registry array they always will be placed after default collectors, so it will be .
The text was updated successfully, but these errors were encountered:
Registry collector search сomputational complexity is O(N) where N is quantity of collectors
metrics/metrics/registry.lua
Line 18 in 925708a
But Lua has hash tables, and with them we can search with O(1) at most times (and it's not like hash collision will happen often with standard number of collectors). All we need is to use kind+name key instead of plain array, i.e.
instead of
since kind+name must be unique. Moreover, it is more common to search for user collectors, but in registry array they always will be placed after default collectors, so it will be .
The text was updated successfully, but these errors were encountered: