Skip to content

authz: cache duration metric for subrepo perms

Administrator requested to merge k/more-metric-caching into main

Created by: keegancsmith

I missed this in my previous commit, but we should also cache this metric. This provides another additional huge speedup of 58% on paths/s. Additionally I added a comment explaining why we cache WithLabelValues as well as providing a more useful help string for the metric.

name                 old time/op  new time/op  delta
FilterActorPaths-32  2.83ms ± 6%  1.78ms ± 3%  -36.97%  (p=0.000 n=10+9)

name                 old paths/s  new paths/s  delta
FilterActorPaths-32   1.77M ± 6%   2.80M ± 3%  +58.49%  (p=0.000 n=10+9)

Test Plan: go test

Merge request reports

Loading