APM JavaScript Extensions - is it possible to get the timestamp for metrics being processes?
search cancel

APM JavaScript Extensions - is it possible to get the timestamp for metrics being processes?

book

Article ID: 368922

calendar_today

Updated On:

Products

DX APM SaaS DX Application Performance Management CA Application Performance Management (APM / Wily / Introscope)

Issue/Introduction

In a JavaScript extension, I want to vary calculations depending on time of day, day of week, whether public holiday etc

Can JavaScript extension code access the timestamp on each input metric is processes, or does it just have to relay on JavaScript Date.now() function?  If using Date.now(), will the timestamp on all metrics created by JavaScript be most recent 15-second boundary or the first 15-second boundary after 'now'?

Environment

DX APM SaaS or onpremise

Resolution

There is property stopTimestampInMillis that returns the time when the metric value is valid, e.g.:

metricData[i].timeslicedValue.stopTimestampInMillis

Additional Information