Skip to content

Commit

Permalink
fix: rename _finishTime to _endTime
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Jul 27, 2019
1 parent 763dc2b commit 0d420cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/opentelemetry-basic-tracer/src/Span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Span implements types.Span {
private _name: string;
private _ended = false;
private _startTime: number;
private _finishTime = 0;
private _endTime = 0;

/** Constructs a new Span instance. */
constructor(
Expand Down Expand Up @@ -115,7 +115,7 @@ export class Span implements types.Span {
end(endTime?: number): void {
if (this._isSpanEnded()) return;
this._ended = true;
this._finishTime = endTime || performance.now();
this._endTime = endTime || performance.now();
// @todo: record or export the span
}

Expand All @@ -132,7 +132,7 @@ export class Span implements types.Span {
kind: this._kind,
status: this._status,
startTime: this._startTime,
finishTime: this._finishTime,
endTime: this._endTime,
});
return `Span${json}`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-basic-tracer/test/Span.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Span', () => {

assert.strictEqual(
span.toString(),
`Span{"traceId":"${context.traceId}","spanId":"${context.spanId}","name":"${name}","kind":1,"status":{"code":0},"startTime":100,"finishTime":0}`
`Span{"traceId":"${context.traceId}","spanId":"${context.spanId}","name":"${name}","kind":1,"status":{"code":0},"startTime":100,"endTime":0}`
);
});
});

0 comments on commit 0d420cf

Please sign in to comment.