Skip to content

Add ProfilingBlockDevice API doc #320

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

Merged
merged 5 commits into from
Oct 31, 2017

Conversation

kegilbert
Copy link
Contributor

DEPENDENT ON ARMmbed/mbed-os#5395

The class reference link will be broken until the above PR is merged and the doxygen docs are regenerated.

@AnotherButler
@sg-

Delete that pesky Oxford comma.
Copy link
Contributor

@AnotherButler AnotherButler left a comment

Choose a reason for hiding this comment

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

This looks good. Please address my queries and comments. Also, thanks for the large dependency note. It's awesome.

@@ -1,2 +1,15 @@
## ProfilingBlockDevice

The ProfilingBlockDevice class provides a BlockDevice implementation to wrap around an existing block device object to log reads, writes and erases.
Copy link
Contributor

Choose a reason for hiding this comment

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

Content query: Is this too much like calling this a wrapper?

Copy link
Member

Choose a reason for hiding this comment

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

To be more precise the ProfilingBlockDevice class is a decorator which adds profiling capabilities to a BlockDevice instance.

@sg- What is our position on design pattern terminology ? Should we use it or avoid it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should use it.

@@ -1,2 +1,15 @@
## ProfilingBlockDevice

The ProfilingBlockDevice class provides a BlockDevice implementation to wrap around an existing block device object to log reads, writes and erases.

ProfilingBlockDevices take in a pointer to the block device being profiled as the only configurable parameter. All block device operations that wish to be logged need to be performed through the ProfilingBlockDevice object.
Copy link
Contributor

Choose a reason for hiding this comment

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

Query: What does it mean that the operations need to be performed through the object? Please clarify. Also, please stop personifying operations. They don't like it when you do that.

Copy link
Contributor Author

@kegilbert kegilbert Oct 30, 2017

Choose a reason for hiding this comment

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

In order for read, write, and erase calls to be counted, they need to be be called from the ProfilingBlockDevice object, not the underlying block device directly.
In other words given a block device object bd, and a profilingblockdevice object profiler pointing to bd you'd need to call

profiler.read(....);

rather than

bd.read(...);

I can rephrase that to be more clear and remove the personified operations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. Makes sense. Please do. Thanks. 👍

@kegilbert
Copy link
Contributor Author

@AnotherButler Rephrased the use case a bit.

Delete another sneaky comma, and change passive to active voice.
Copy link
Contributor

@AnotherButler AnotherButler left a comment

Choose a reason for hiding this comment

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

Nice changes. 👍

@AnotherButler AnotherButler requested a review from sg- October 30, 2017 21:14
@kegilbert
Copy link
Contributor Author

@AnotherButler @pan- Updated the phrasing to use decorator.

@AnotherButler AnotherButler merged commit 9bd0939 into ARMmbed:new_engine Oct 31, 2017
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