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

Support CUE_STATS_FILE with the SDK #3636

Open
verdverm opened this issue Dec 28, 2024 · 1 comment
Open

Support CUE_STATS_FILE with the SDK #3636

verdverm opened this issue Dec 28, 2024 · 1 comment
Labels
FeatureRequest New feature or request Triage Requires triage/attention

Comments

@verdverm
Copy link

Is your feature request related to a problem? Please describe.

CUE_STATS_FILE can be set be end users of the CLI to get helpful info about how their code runs in the evaluator. Users of the SDK cannot make use of this (accurately) because some of the stats API requires access to internal packages

adt.ResetStats()

Describe the solution you'd like

CUE_STATS_FILE to work via the SDK

Describe alternatives you've considered

It doesn't seem possible to access stats directly because much of it requires access to the adt package

Additional context

hof user asked why this doesn't work with hof

@verdverm verdverm added FeatureRequest New feature or request Triage Requires triage/attention labels Dec 28, 2024
@mvdan
Copy link
Member

mvdan commented Dec 31, 2024

I've brought up the same to Marcel in the past, this would indeed be nice to have. We just have to be careful to clearly document that the structure of the stats is unstable and may change with future CUE versions. We could make the struct fully opaque to hide the fields from the user entirely, or use a map[string]any, although that also makes using the stats directly in Go rather annoying. I'd be fine with exposing a plain struct with exported fields as long as the documentation is clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

2 participants