Skip to content

Cleanup load average handling#21037

Merged
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:load-average-cleanup
Oct 20, 2016
Merged

Cleanup load average handling#21037
jasontedor merged 1 commit intoelastic:masterfrom
jasontedor:load-average-cleanup

Conversation

@jasontedor
Copy link
Copy Markdown
Member

This commit cleans up the code handling load averages in OsProbe:

  • remove support for BSD; we do not support this OS
  • add Javadocs
  • strengthen assertions and testing
  • add debug logging for exceptional situation

This commit cleans up the code handling load averages in OsProbe:
 - remove support for BSD; we do not support this OS
 - add Javadocs
 - strengthen assertions and testing
 - add debug logging for exceptional situation
@jasontedor jasontedor added review :Core/Infra/Stats Statistics tracking and retrieval APIs v6.0.0-alpha1 v5.1.1 labels Oct 20, 2016
}

public void testGetSystemLoadAverage() {
assumeTrue("test runs on Linux only", Constants.LINUX);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could probably avoid this by making the linux check a method that you stub out in OsProbe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thought about that, but there's more to it because the getSystemLoadAverage method starts with if (Constants.WINDOWS) so then that has to stubbed out too, and then it's just not worth it? We have sufficient coverage on Linux with the CI.

@jasontedor jasontedor merged commit 3c7c872 into elastic:master Oct 20, 2016
jasontedor added a commit that referenced this pull request Oct 20, 2016
This commit cleans up the code handling load averages in OsProbe:
 - remove support for BSD; we do not support this OS
 - add Javadocs
 - strengthen assertions and testing
 - add debug logging for exceptional situation

Relates #21037
@jasontedor
Copy link
Copy Markdown
Member Author

Thanks @nik9000.

@jasontedor jasontedor deleted the load-average-cleanup branch October 20, 2016 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Stats Statistics tracking and retrieval APIs >non-issue v5.1.1 v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants