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
obj: implement statistics boilerplate macros #2459
Conversation
9d6c2ae
to
e15e13a
Compare
Reviewed 32 of 32 files at r1. src/libpmemobj/libpmemobj.vcxproj, line 53 at r1 (raw file):
same file twice? src/libpmemobj/obj.h, line 139 at r1 (raw file):
So the stats content is limited by the size of pmem_reserved? src/libpmemobj/stats.c, line 73 at r1 (raw file):
src/libpmemobj/stats.c, line 88 at r1 (raw file):
initializes src/libpmemobj/stats.c, line 113 at r1 (raw file):
src/libpmemobj/stats.h, line 82 at r1 (raw file):
no atomic load here? src/test/obj_ctl_stats/obj_ctl_stats.c, line 41 at r1 (raw file):
obj_ctl_stats src/test/obj_ctl_stats/TEST0, line 40 at r1 (raw file):
fs any ? Comments from Reviewable |
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. src/libpmemobj/libpmemobj.vcxproj, line 53 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
Done. src/libpmemobj/obj.h, line 139 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
src/libpmemobj/stats.c, line 73 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
The majority of statistics should be transient and used to decide how to optimize the use of the library. I do not recommend using these kind of values to make runtime decisions... But we are where we are. I don't think stats "enabled" should be persistent state - it should be off by default and if you want to debug your application you can enable them through a ctl query. If one wants to ignore recommendations and use them for unintended purposes, one can always use a config file to specify that "stats.enabled = 1;". src/libpmemobj/stats.c, line 88 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
Done. src/libpmemobj/stats.c, line 113 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
In the design I've decided not to flush the variables at every store - as you rightly notice, it would be too expensive. We might eventually implement a mechanism for the potential drift that might happen, but that's for the future. src/libpmemobj/stats.h, line 82 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
Done. src/test/obj_ctl_stats/obj_ctl_stats.c, line 41 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
Done. src/test/obj_ctl_stats/TEST0, line 40 at r1 (raw file): Previously, krzycz (Krzysztof Czurylo) wrote…
what does that change? what's the default? Comments from Reviewable |
fcd7f57
to
191e726
Compare
Reviewed 11 of 11 files at r2. src/test/obj_ctl_stats/TEST0, line 40 at r1 (raw file): Previously, pbalcer (Piotr Balcer) wrote…
AFAIR, default is "pmem non-pmem", so w/o "any" the test will be executed twice. Comments from Reviewable |
191e726
to
bb9bf6b
Compare
doc/libpmemobj/pmemobj_ctl_get.3.md
Outdated
stats.enabled | rw | - | int | int | - | boolean | ||
|
||
Enables or disables runtime collection of statistics. The statistics are never | ||
altered after enabling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by "are never altered after enabling"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statistics are not recalculated whenever you enable them. In other words, if you disable statistics, the operations that are performed won't count towards statistic values after you enable them again.
bb9bf6b
to
87639a1
Compare
Codecov Report
@@ Coverage Diff @@
## master #2459 +/- ##
==========================================
- Coverage 80.03% 79.94% -0.09%
==========================================
Files 121 122 +1
Lines 21002 21038 +36
Branches 3791 3794 +3
==========================================
+ Hits 16808 16819 +11
- Misses 4194 4219 +25 |
doc/libpmemobj/pmemobj_ctl_get.3.md, line 326 at r3 (raw file):
Statistics are not recalculated after enabling; any operations that occur between disabling and re-enabling will not be reflected in subsequent values. Comments from Reviewable |
doc/libpmemobj/pmemobj_ctl_get.3.md, line 326 at r3 (raw file):
may Comments from Reviewable |
doc/libpmemobj/pmemobj_ctl_get.3.md, line 337 at r4 (raw file):
may Comments from Reviewable |
Reviewed 1 of 1 files at r3, 1 of 2 files at r4. Comments from Reviewable |
... and add one example statistic: size in bytes of the curently allocated objects.
87639a1
to
8ab8c6c
Compare
Review status: 34 of 35 files reviewed at latest revision, 2 unresolved discussions. doc/libpmemobj/pmemobj_ctl_get.3.md, line 326 at r3 (raw file): Previously, gaweinbergi (Glenn Weinberg) wrote…
Done. doc/libpmemobj/pmemobj_ctl_get.3.md, line 337 at r4 (raw file): Previously, gaweinbergi (Glenn Weinberg) wrote…
Done. Comments from Reviewable |
Reviewed 1 of 1 files at r5. Comments from Reviewable |
... and add one example statistic:
size in bytes of the curently allocated objects.
Ref: pmem/issues#676
This change is