Skip to content
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

DM-10779: Implement running time metric(s) #3

Merged
merged 7 commits into from Aug 31, 2017
Merged

Conversation

kfindeisen
Copy link
Member

This PR adds a function for extracting running time from Task metadata, and adds some infrastructure to ap_verify to support it and future features.

@kfindeisen kfindeisen requested a review from ebellm August 10, 2017 23:51
@kfindeisen kfindeisen force-pushed the tickets/DM-10779 branch 3 times, most recently from 1d37418 to 3e7cca1 Compare August 14, 2017 16:09
Copy link
Contributor

@ebellm ebellm left a comment

Choose a reason for hiding this comment

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

Just three high-level comments:

I don't want us wrapping ap_pipe libraries in a special ApPipe object. I'd rather we call the required library functions directly from run_ap_verify().

I think slightly more descriptive names for api.py and performance.py would be useful.

# see <http://www.lsstcorp.org/LegalNotices/>.
#

"""Code for measuring software performance metrics.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be called something more descriptive than "api.py?"

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't think of one, and still can't. This file's purpose is to provide a single point of entry to the measurements sub-package, so that ap_verify.py doesn't need to know about implementation details like "which measurements have actually been implemented"?

Is there a name that communicates that to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

What about compute_metrics? "API" suggests to me a library with multiple methods, not an abstraction layer.

A top-level docstring which better indicated the purpose of the package would help here--the code for measuring metrics is not actually in this file.


import lsst.verify


Copy link
Contributor

Choose a reason for hiding this comment

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

similarly, could this be called something more descriptive than "performance.py?"

Copy link
Member Author

Choose a reason for hiding this comment

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

Such as? measurements/performance.py seems to quickly summarize what the code is for.

Copy link
Contributor

Choose a reason for hiding this comment

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

It depends where you plan to put other metrics code--it's all "performance" at some level. If you're thinking of small packages, runtime_metrics.py would be more clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

"runtime" to me sounds like "not compile-time", but I see your point. How about profiling.py?

(I'd prefer to avoid 'metrics' or 'measurement' in the name to avoid Department of Redundancy Department).

Copy link
Contributor

Choose a reason for hiding this comment

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

okay, that works for me.

@kfindeisen
Copy link
Member Author

kfindeisen commented Aug 18, 2017

I am willing to replace the ApPipe class with the function-based module that came before it -- the former was a request by @djreiss in the previous review that, as Lupton warned us to watch out for yesterday, constitutes scope creep. Note that the ap_pipe wrapper is outside the scope of this ticket, so it may be easier (particularly for @mrawls) if we create a new ticket to make that change.

However, I must strongly object to dumping the ApPipe code into run_ap_verify. This would not only bloat that function well beyond its already long length and make the code more complicated, but add extra, implementation-specific dependencies between the main ap_verify module and ap_pipe. If we want any hope of having ap_verify be easy to maintain and improve in the future, everything that depends on ap_pipe needs to be in its own module, safely compartmentalized from the rest of the system rather than mixed in with code related to argument and metrics management

@ebellm
Copy link
Contributor

ebellm commented Aug 18, 2017

Okay, I'll let you refactor the code to be more functional, but I don't agree that ap_verify needs to be strictly compartmentalized from the details of ap_pipe--it should just be a small wrapper to add the metrics and verification support. I'd prefer tighter coupling to keep the package lightweight.

@kfindeisen kfindeisen force-pushed the tickets/DM-10779 branch 2 times, most recently from a9e032f to a4f0c47 Compare August 24, 2017 23:48
kfindeisen and others added 7 commits August 31, 2017 13:51
Metadata will be used to recover Measurements from individual pipeline
Tasks, and to compute "afterburner" metrics. The Pipeline API has been
changed to support metadata, and a method has been added to Pipeline
to support current plans for Measurement handling.
Basic parsing is delegated to daf.persistence.Policy. The config
loading has been factored into a singleton class to ensure options are
only loaded once while decoupling it from other ap_verify code.
The measurement code has been put in a subpackage, measurements, which
is expected to have many other measurements added to it in the future.
Package was not ready to add before.
This change reduces the conceptual complexity of ap_verify, and
makes the data flow more obvious. Dependencies on the ap_pipe API
are still contained in a separate module, where they can't clutter
up the top-level logic.
@kfindeisen kfindeisen merged commit 25eb227 into master Aug 31, 2017
@kfindeisen kfindeisen deleted the tickets/DM-10779 branch November 30, 2018 22: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
3 participants