Ping gateway - how many ping should be lost to trigger it?

Hello,

we all know nice feature of ping remote gateway to check if link is up. I used to use this feature together with recursive routing:

  1. ip route 8.8.8.8/32 → ISP_gateway
  2. ip route 0.0.0.0/0 → 8.8.8.8 (ping gateway)

and it works fine but I still worry what if 1 ping packet out of 50 of 100 be lost - the route will be recalculated at that very moment or there is some threshold (like 2 out of 10 packets or something)?

Is there a way to tune this threshold and maybe change timeouts for ping check to be considered as failed?

Surely I can do the same check with scripts or/and netwatch feature but this recursive approach is quite elegant one so I’d prefer to know I can tune it a bit in a case when WAN link is a bit fuzzy (say, link over radio when the weather is bad).

Thank you in advance!