w3c / server-timing

Server Timing
http://w3c.github.io/server-timing/
Other
75 stars 20 forks source link

Metric values are timestamps in PerformanceServerTiming interface #7

Closed bripkens closed 7 years ago

bripkens commented 7 years ago

Is it intended that all metric values have to be timestamps? I am confused right now about the scope of this specification as the header is described as defining generic metric key/value pairs. The PerformanceServerTiming interface, on the other hand, is limiting values to explicitly be DOMHighResTimeStamps (which basically means doubles, which should be fine). Additionally, the field is called duration.

I'd expect the duration field to be called value and for it to be typed double to make it clearer that this is about any type of metric.

igrigorik commented 7 years ago

PerformanceServerTiming inherits from PerformanceEntry, which is the base for all the metrics we expose via PerformanceTimeline. So, yes, it has to be a DOMHighResTimestamp.

That said, you don't have to provide the duration and can focus on name+description. See example here: http://wicg.github.io/server-timing/#examples

bripkens commented 7 years ago

Okay, so it is called duration for compatibility reasons. Thanks for explaining @igrigorik!