Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cue/stats: add metric for builtin calls #2587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bozaro
Copy link
Contributor

@bozaro bozaro commented Sep 11, 2023

Add Builtins metric to allow tests for issues like #2566

Signed-off-by: Artem V. Navrotskiy <bozaro@yandex.ru>
Signed-off-by: Artem V. Navrotskiy <bozaro@yandex.ru>
Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll run this past Marcel to see if he agrees that having builtin call counters in the stats is useful. I think it can be helpful when debugging or testing, like in your test in #2588, so I don't oppose adding this stat.

We might want this metric counter in a slightly different form, like Calls. Once we add function signatures to the language per #2007, perhaps implemented by wasm, then those could be counted the same way. I don't think splitting builtins calls from other function calls would be necessary.

@@ -1481,6 +1481,7 @@ func (x *CallExpr) evaluate(c *OpContext, state vertexStatus) Value {
if b.IsValidator(len(args)) {
return &BuiltinValidator{x, b, args}
}
c.stats.Builtins++
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that BuiltinValidator ends up calling the call method as well; you should probably increment the counter inside that method to capture all builtin calls being performed.

@mvdan mvdan self-assigned this Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants