How to calculate percentage of uptime using grafana and prometheus

Currently I am calculating uptime % using below query.

But if I try to test by restarting a service that is if i restart at 11:00 and if i try to test at 11:05 it should show 100% availability , but in my case it is not showing that way.

Please help out with correct calculation for uptime %


avg_over_time(up{instance="$instance", job!="jobid"}[${__range_s}s])*100