Kibana Search Latency

Hello, I want to know how kibana search latency is calculated. Because I don't understand the kibana source code, so I want to ask you to help me

I'm assuming you are referring to the search latency in stack monitoring - this is the

Average latency for searching, which is time it takes to execute searches divided by number of
searches submitted. This considers primary and replica shards.