Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

sub millisecond durations are not recorded with @opencensus/exporter-ocagent #705

Open
andrewmtoy opened this issue Nov 6, 2019 · 0 comments
Labels

Comments

@andrewmtoy
Copy link

andrewmtoy commented Nov 6, 2019

What version of OpenCensus are you using?

0.0.16

What version of Node are you using?

v10.15.1

What did you do?

I created spans that take less than one millisecond and exported them with @opencensus/exporter-ocagent.

What did you expect to see?

I expected to see spans with sub-millisecond durations.

What did you see instead?

Saw span durations of 0 seconds.

Additional context

I believe the bug is on this line:
https://github.com/census-instrumentation/opencensus-node/blob/master/packages/opencensus-core/src/internal/clock.ts#L75

If this.ended is true and this.duration is between 0 and 1 millisecond, the endTime.getTime() returned is the same as this.startTime.getTime() because Date has millisecond resolution.

@andrewmtoy andrewmtoy added the bug label Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant