Skip to content

Commit 089147f

Browse files
committed
ref: Rename _timestamp to _end_timestamp
1 parent 1690236 commit 089147f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

sentry_sdk/traces.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def __init__(
291291
self._sample_rate = sample_rate
292292

293293
self._start_timestamp = datetime.now(timezone.utc)
294-
self._timestamp: "Optional[datetime]" = None
294+
self._end_timestamp: "Optional[datetime]" = None
295295

296296
# profiling depends on this value and requires that
297297
# it is measured in nanoseconds
@@ -327,7 +327,7 @@ def __enter__(self) -> "StreamedSpan":
327327
def __exit__(
328328
self, ty: "Optional[Any]", value: "Optional[Any]", tb: "Optional[Any]"
329329
) -> None:
330-
if self._timestamp is not None:
330+
if self._end_timestamp is not None:
331331
# This span is already finished, ignore
332332
return
333333

@@ -361,7 +361,7 @@ def _start(self) -> None:
361361
self._previous_span_on_scope = old_span
362362

363363
def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None:
364-
if self._timestamp is not None:
364+
if self._end_timestamp is not None:
365365
# This span is already finished, ignore.
366366
return
367367

@@ -392,15 +392,15 @@ def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None
392392
pass
393393

394394
if isinstance(end_timestamp, datetime):
395-
self._timestamp = end_timestamp
395+
self._end_timestamp = end_timestamp
396396
else:
397397
logger.debug(
398398
"[Tracing] Failed to set end_timestamp. Using current time instead."
399399
)
400400

401-
if self._timestamp is None:
401+
if self._end_timestamp is None:
402402
elapsed = nanosecond_time() - self._start_timestamp_monotonic_ns
403-
self._timestamp = self._start_timestamp + timedelta(
403+
self._end_timestamp = self._start_timestamp + timedelta(
404404
microseconds=elapsed / 1000
405405
)
406406

@@ -480,7 +480,7 @@ def start_timestamp(self) -> "Optional[datetime]":
480480

481481
@property
482482
def timestamp(self) -> "Optional[datetime]":
483-
return self._timestamp
483+
return self._end_timestamp
484484

485485
def _is_segment(self) -> bool:
486486
return self._segment is self

0 commit comments

Comments
 (0)