Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Fix parsing overflow issue (#24) #25

Merged
merged 1 commit into from Dec 6, 2019
Merged

Conversation

dabonnie
Copy link
Contributor

@dabonnie dabonnie commented Dec 5, 2019

Signed-off-by: Devin Bonnie dbbonnie@amazon.com

Update system cpu measurement name to reflect units

Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
@dabonnie dabonnie self-assigned this Dec 5, 2019
@@ -34,6 +34,8 @@ constexpr const char proc_sample_2[] =
constexpr const std::chrono::milliseconds TEST_PERIOD =
std::chrono::milliseconds(50);
constexpr const double CPU_ACTIVE_PERCENTAGE = 2.7239908106334099;
constexpr const char proc_sample_resolution_test[] =
Copy link
Member

Choose a reason for hiding this comment

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

Why not put this (and other proc_samples) into test_constants.hpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not put this (and other proc_samples) into test_constants.hpp?

I created the test constants file for the shared constants between tests, but didn't have a strong opinion about the location of the constants in question. For consistency I think it makes sense to move them so will do so - thanks for the suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

I did suggest it for consistency.

However, if test_constants.hpp were a clean slate, my first thought would be to keep the memory strings in test_linux_memory_measurement.cpp and the CPU strings kept here in test_linux_cpu_measurement.cpp, but things like TEST_PERIOD and INVALID_PUBLISH_WINDOW be moved to test_constants.hpp.

With my upcoming unit tests, there will be more things to put into test_constants.hpp, so don't worry about it being under-utilized.

Copy link
Contributor

Choose a reason for hiding this comment

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

seems to me like it'd make sense to just put this in the test itself, until it's actually being shared...?

Copy link
Member

Choose a reason for hiding this comment

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

TEST_PERIOD and INVALID_PUBLISH_WINDOW are examples of what's already common between test_linux_memory_measurement.cpp and test_linux_cpu_measurement.cpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI the constants defined in the test_constants.hpp file are shared. Since none of the CPU constants are currently shared I'll forgo moving them and merge this PR.

@dabonnie dabonnie merged commit 4c0a208 into master Dec 6, 2019
@dabonnie dabonnie deleted the cpu-parsing-resolution branch December 6, 2019 00:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants