Page MenuHomePhabricator

EventBus should set dt fields with greater precision than second
Closed, DeclinedPublic

Description

EventBus uses MediaWiki's wfTimestamp with the TS_ISO_8601 format specifier. This causes timestamps to be formatted with only second precision. We should emit with fractional seconds, either millisecond or microsecond.

  • EventBus emits datetime fields in ISO-8601 format with at least millisecond precision
NOTE: MediaWiki provided timestamps will all have .000 as the seconds fraction.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@xcollazo this task should be pretty easy to do if you want to try your hand at some PHP!

Are you trying to nerd snipe me?! 😄

Hah! Just trying to encourage everyone to feel a little autonomy when they want something done! :D

It looks like doing this for any timestamps that are provided by MediaWiki to EventBus will be more difficult, as they are given as MW formatted strings with only second precision.

However, since meta.dt is set by EventBus as the current timestamp, it should be possible to ensure that this field has milli or micro second precision.

Change 933176 had a related patch set uploaded (by Ottomata; author: Ottomata):

[mediawiki/extensions/EventBus@master] EventSerializer::timestampToDt use milliseconds fraction in date time format

https://gerrit.wikimedia.org/r/933176

It looks like doing this for any timestamps that are provided by MediaWiki to EventBus will be more difficult, as they are given as MW formatted strings with only second precision.

What are cases where millisecond fractions matter to Event Platform consumers?
Do we have producers other than Flink that emit timestamps at this resolution?

What are cases where millisecond fractions matter to Event Platform consumers?

See T335860#8953786 for a discussion of what triggered this work.

Change 933176 abandoned by Ottomata:

[mediawiki/extensions/EventBus@master] EventSerializer::timestampToDt use milliseconds fraction in date time format

Reason:

This isn't worth it. MW timestamps are all second precision anyway. And, the preferred way of setting meta.dt here is to leave it as null and let eventgate set it.

https://gerrit.wikimedia.org/r/933176

I'm declining this task. I realized that we let eventgate handle setting meta.dt right now anyway, so its precision should be fine. Not much we can do about MW provided timestamps, since they are in second precision anyway.