8000 APM-209 by cpjulia · Pull Request #15067 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

APM-209 #15067

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? 8000 Sign in to your account

Merged
merged 22 commits into from
Nov 16, 2021
Merged

APM-209 #15067

merged 22 commits into from
Nov 16, 2021

Conversation

cpjulia
Copy link
Contributor
@cpjulia cpjulia commented Nov 8, 2021

Scope & Purpose

This is related to https://arangodb.atlassian.net/browse/APM-209.
Histogram displaying is now switched off by default. For displaying it, the new flag histogram.generate must be set to true. Its default value is false for compatibility with other versions and also for complying with the histogram not being displayed by default.
If this flag is not set to true, but other histogram flags are addressed, e.g. --histogram.interval-size 500, everything will still run normally, but a warning message will be displayed saying that the histogram is switched off and setting this flag would not be of use.

  • 💩 Bugfix (requires CHANGELOG entry)
  • 🍕 New feature (requires CHANGELOG entry, feature documentation and release notes)
  • 🔥 Performance improvement
  • 🔨 Refactoring/simplification
  • 📖 CHANGELOG entry made

Backports:

  • Backport for 3.9:

Related Information

Testing & Verification

  • This change is a trivial rework / code cleanup without any test coverage.
  • The behavior in this PR was manually tested
  • This change is already covered by existing tests, such as (please describe tests).
  • This PR adds tests that were used to verify all changes:
    • Added new C++ Unit tests
    • Added new integration tests (e.g. in shell_server / shell_server_aql)
    • Added new resilience tests (only if the feature is impacted by failovers)
  • There are tests in an external testing repository:
  • I ensured this code runs with ASan / TSan or other static verification tools

@jsteemann jsteemann added this to the devel milestone Nov 8, 2021
10000
@cpjulia cpjulia requested review from gnusi November 10, 2021 19:38
@@ -239,6 +242,24 @@ void BenchFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
"--verbose", "print out replies if the HTTP header indicates DB errors", false);
}

void BenchFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
if (options->processingResult().touched("--histogram.interval-size")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we warn a user even if --histogram.generate is true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in latest commit

pp << std::fixed << std::right << std::setw(12) << std::setprecision(2)
<< percentile << "%";
if (_generateHistogram) {
setupHistogram(pp, builder);
Copy link
Contributor

Choose a reason for hiding this comment

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

it's really hard to follow who is responsible for forming a builder structure.
I'd be in favor of at least moving builder.add("histogram", VPackValue(VPackValueType::Object)); out of setupHistogram, so everything is handled in BenchFeature::start()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in latest commit

@@ -556,31 +605,24 @@ bool BenchFeature::report(ClientFeature& client, std::vector<BenchRunResult> res
printResult(output, builder);
builder.close();

std::cout << "Min request time: " << std::setprecision(6)
std::cout << "Min request time: " << std::setprecision(4)
Copy link
Contributor

Choose a reason for hiding this comment

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

is making results less precise intentional? why 6 digits was bad?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We actually don't need more than 4 digits for handling the measurements in the histogram, it's less than milliseconds

@@ -482,10 +526,13 @@ void BenchFeature::start() {
*_result = ret;
}

bool BenchFeature::report(ClientFeature& client, std::vector<BenchRunResult> results,
void BenchFeature::report(ClientFeature& client, std::vector<BenchRunResult>& results,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be in favor of passing std::vector<BenchRunResult>& results as std::vector<BenchRunResult> const& results and sort results in a caller. In BenchFeature::report we can add an assertion that results are sorted, like TRI_ASSERT(std::is_sorted(...))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in latest commit, but can still have room for more optimization

@@ -56,119 +56,141 @@ const testPaths = {
// //////////////////////////////////////////////////////////////////////////////

Copy link
Contributor

Choose a reason for hiding this comment

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

are there any tests checking new functionality?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's because, at the moment, we don't have any infrastructure to test arangobench

Copy link
Contributor
@gnusi gnusi left a comment

Choose a reason for hiding this comment

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

LGTM

@jsteemann jsteemann merged commit 3128a9c into devel Nov 16, 2021
@jsteemann jsteemann deleted the feature/APM-209 branch November 16, 2021 13:04
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.

4 participants
0