forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rego: Stop counting metrics for "no-op" steps
We had a number of helper methods that would start a timer, defer stopping it, and then do something to setup a Rego object for doing its thing. Many of these would have a check and then skip the step, but the timer would get a little bit of time accounted for it anyway for the `if` check and handling the deferred stop function. This refactors as many of these as I could find to do the if check and shortcut out before starting the timer. This will prevent any of the "no-op" steps from showing up in metrics. Signed-off-by: Patrick East <[email protected]>
- Loading branch information
1 parent
051c3b8
commit 2699974
Showing
2 changed files
with
70 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters