Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
This repository was 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

Description

@andrewmtoy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions