0
votes

I am trying to get the current timestamp (in microseconds) for the Google Cloud Dataflow execution to transform BigQuery record. For this issue, I use this instruction:

performance.timing.navigationStart + performance.now()

But, it's not working. Why? Is there any way to get microseconds in dataflow javascript UDF?

Thanks in advance.

1
According to MDN, performance.timing is deprecated and you should be using PerformanceNavigationTiming. - RobG

1 Answers

2
votes

Dataflow doesn't support js UDF natively. Maybe you are using some Google provided templates.

If that's the case, it uses javax.script.ScriptEngine:

https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/master/src/main/java/com/google/cloud/teleport/templates/common/JavascriptTextTransformer.java#L138

So you can try it out locally to figure out what syntax it supports.

Thanks.