Skip to content

Conversation

@marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Sep 7, 2022

Recreated from #906

@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2022

⚠️ The sha of the head commit of this PR conflicts with #906. Mergify cannot evaluate rules on this PR. ⚠️

@marc-gr
Copy link
Contributor Author

marc-gr commented Sep 7, 2022

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2022

refresh

✅ Pull request refreshed

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 7, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-08T13:48:58.596+0000

  • Duration: 26 min 13 sec

Test stats 🧪

Test Results
Failed 0
Passed 823
Skipped 0
Total 823

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 7, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (34/34) 💚
Files 66.929% (85/127) 👎 -0.284
Classes 61.667% (111/180) 👎 -1.275
Methods 48.693% (354/727) 👎 -1.235
Lines 32.074% (3201/9980) 👎 -1.28
Conditionals 100.0% (0/0) 💚

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks Marc for continuing with this! I have added some comments, but mostly questions and nitpicking.

I think that this is mostly fine, maybe we can merge it and continue with follow ups. It looks quite useful already as is.

},
{
"@timestamp": "2016-10-25T12:49:34.000Z",
"message": "127.0.0.1 - - [07/Dec/2016:11:05:07 +0100] \"GET /taga HTTP/1.1\" 404 169 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0\"\n"
Copy link
Member

Choose a reason for hiding this comment

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

As we are going to repeat documents to reach num_docs, we may want to add some templatization here, for example to generate dates. In case ES has some kind of cache when parsing certain things.

But to be done as a follow up if needed/wanted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I was thinking about this, maybe even some sort of fuzzing or property based document generation at some point.

// does not default to unmarshaling numeric values to float64 in order to
// prevent low bit truncation of values greater than 1<<53.
// See https://golang.org/cl/6202068 for details.
func jsonUnmarshalUsingNumber(data []byte, v interface{}) error {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should move this to some common place, as is used also in test runner. But it is fine here by now.

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Mostly minor things.

Left a comment about the similarity with the test runner to verify if we should do something about this.

}

// FindBenchmarkFolders finds benchmark folders for the given package and, optionally, benchmark type and data streams
func FindBenchmarkFolders(packageRootPath string, dataStreams []string, benchType BenchType) ([]testrunner.TestFolder, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that a lot of the benchrunner logic is similar to the testrunner. Frankly speaking, we consider that part of elastic-package as a candidate to be refactored :) I'm wondering if you can extract some common elements of both runners.

If it's a stupid idea, feel free to decline. I know that the logic is tangled here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I preferred to duplicate it in this case is because I am not sure of how this feature might evolve in the near future, so is possible that the logic starts diverging more as time goes by. I am happy to do that if you prefer so now, but given the logic is quite coupled I think it was safer to just assume some level of duplication given both features are isolated and are not intended to evolve together at this point.

 - Rename benchrunner.go -> benchmark.go
 - Add data-streams as a persistent flag
 - Add num-top-procs flag
 - Implement Stringer for BenchmarkValue
 - Rename benchFmtd -> benchFormatted
 - Make constants global
@marc-gr marc-gr requested review from jsoriano and mtojek September 8, 2022 09:19
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

LGTM!

Nice job @adriansr and @marc-gr :) Please email the internal group to share more details on how to use it!

@mtojek
Copy link
Contributor

mtojek commented Sep 8, 2022

@dependabot merge upstream

@mtojek mtojek merged commit e0f49ac into elastic:main Sep 8, 2022
@marc-gr marc-gr deleted the bench_pipelines branch September 8, 2022 14:29
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.

5 participants