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
chore(xmlupload): add metrics flag (DEV-1512) #264
Conversation
other small improvements
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.
Looks good
knora/dsplib/utils/xml_upload.py
Outdated
@@ -26,6 +28,8 @@ | |||
from knora.dsplib.models.xmlresource import XMLResource | |||
from knora.dsplib.utils.shared import try_network_action, validate_xml_against_schema | |||
|
|||
MetricRecord = namedtuple("MetricRecord", ["res_id", "filetype", "filesize_mb", "event", "duration_microsec", "mb_per_sec"]) |
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.
I like this pattern of using a data structure ("product type" in functional terminology) as a model for data in code. Personally I tend to implement this using dataclasses rather than namedtuples... but that's just a matter of taste.
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.
LGTM
resolves DEV-1512