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

Sampling support #138

Open
ejrgilbert opened this issue Aug 21, 2024 · 0 comments
Open

Sampling support #138

ejrgilbert opened this issue Aug 21, 2024 · 0 comments
Labels
enhancement New feature or request investigation Issue to document idea and research while investigating it

Comments

@ejrgilbert
Copy link
Owner

This is dependent on #135.

We could do some sugaring to expand simple sampling logic for probes. Consider:

wasm:opcode:if:before {
    local int fire;
    if fire == 0 {
        ... // probe body
        count = rand() % 1000;
    }
    fire--;
}

We could sugar this to:

wasm:opcode:if:sample-1000 {
    ... // probe body
}

More complex examples (requires more language features)

There are also some other more-complex sampling techniques, e.g. reservoir sampling, that could be implemented and made available through just implementing them in the whamm library. So, the sampling logic would exist in whamm's Rust library, which is called to check if the probe should be fired.

@ejrgilbert ejrgilbert added enhancement New feature or request investigation Issue to document idea and research while investigating it labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigation Issue to document idea and research while investigating it
Projects
None yet
Development

No branches or pull requests

1 participant