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

tests: adds mage target for CRS benchmarks. #1003

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcchavezs
Copy link
Member

Ease benchmark running

@jcchavezs jcchavezs requested a review from a team as a code owner February 13, 2024 09:27
Copy link
Member

@M4tteoP M4tteoP left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -53,7 +53,7 @@ func BenchmarkCRSCompilation(b *testing.B) {
}
}

func BenchmarkCRSSimpleGET(b *testing.B) {
func BenchmarkCRSRuntimeSimpleGET(b *testing.B) {
Copy link
Contributor

@anuraaga anuraaga Feb 13, 2024

Choose a reason for hiding this comment

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

I'm not too clear on what Runtime means here. If it means running time of the operation, I think all benchmarks measure that so doesn't need to be in name


func CRSBenchmark() error {
bench := "BenchmarkCRSRuntime(Simple|Large)(GET|POST)"
err := sh.RunV("go", "test", "-run=^$,", "-benchmem", "-bench=^"+bench+"$", "./testing/coreruleset", "-cpuprofile=cpuprof.out")
Copy link
Member

Choose a reason for hiding this comment

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

This may be ambiguous; what about running the benchmark for results and adding a parameter to create a CPU profile?

@fzipi
Copy link
Member

fzipi commented Apr 27, 2024

@jcchavezs Care to take a look at comments, or just merge?

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

5 participants