alphagov/performanceplatform-collector — pull request #71 by annapowellsmith (2014-07-04 14:47:09+00:00)
Title: Convert avgSessionDuration metrics from s to ms

Google Analytics returns avgSessionDuration metrics in seconds, but
everywhere in Backdrop and Spotlight expects duration metrics to be
in milliseconds.

After discussion, we have decided it's best to serve our data up
consistently. So convert avgSessionDuration metrics to ms as
part of collection.

This field is used for the "time taken to complete transaction"
graph.

Clearly it would be better to convert all metrics with a data-type
of type "time", or all metrics named duration, rather than just
looking for this specific metric. However despite much hunting
through Google Analytics API documentation, and a question to
the forums, I still can't establish whether the API uses seconds
consistently or whether this is set on a per-field basis.

So I have erred on the side of caution, and only converted this
field to milliseconds. Our API documentation should state that we
return all time fields in milliseconds.