Page MenuHomePhabricator

Record time when thumbor receives the request
ClosedPublic

Authored by Gilles on Feb 6 2018, 12:14 PM.

Details

Maniphest Tasks
T186594: Log time when request makes it to Thumbor
Reviewers
fgiunchedi
Commits
rTHMBREXTdb19799d17f2: Record time when thumbor receives the request
Patch without arc
git checkout -b D966 && curl -L https://phabricator.wikimedia.org/D966?download=true | git apply
Summary

Refs T186594

Diff Detail

Repository
rTHMBREXT Thumbor Plugins
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Gilles created this revision.Feb 6 2018, 12:14 PM
Gilles requested review of this revision.Feb 6 2018, 12:14 PM
fgiunchedi added inline comments.Feb 6 2018, 4:28 PM
wikimedia_thumbor/handler/images/images.py
388

You can avoid the mktime/timetuple roundtrip with (using utcnow since format_date_time seems to assume utc anyway)

now = datetime.datetime.utcnow()
timestamp = now.strftime('%s')
Gilles added inline comments.Feb 7 2018, 2:39 PM
wikimedia_thumbor/handler/images/images.py
388

format_date_time() needs a float, which requires using mktime() for conversion, as far as I can see?

fgiunchedi accepted this revision.Feb 8 2018, 9:48 AM
fgiunchedi added inline comments.
wikimedia_thumbor/handler/images/images.py
388

Indeed you are correct, looks good as it is!

This revision is now accepted and ready to land.Feb 8 2018, 9:48 AM
This revision was automatically updated to reflect the committed changes.