Skip to content

Commit 29fe8ff

Browse files
fix(profiling): tighten ddup types [backport 2.7] (#8685)
Backport ded3a33 from #8668 to 2.7. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: David Sanchez <[email protected]>
1 parent cdfc2ce commit 29fe8ff

File tree

2 files changed

+260
-251
lines changed

2 files changed

+260
-251
lines changed
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import typing
1+
from typing import Dict
22
from typing import Optional
3+
from typing import Union
34

45
from ddtrace._trace.span import Span
56

7+
StringType = Union[str, bytes, None]
8+
69
def init(
7-
env: Optional[str],
8-
service: Optional[str],
9-
version: Optional[str],
10-
tags: Optional[typing.Dict[str, str]],
10+
env: StringType,
11+
service: StringType,
12+
version: StringType,
13+
tags: Optional[Dict[Union[str, bytes], Union[str, bytes]]],
1114
max_nframes: Optional[int],
12-
url: Optional[str],
15+
url: StringType,
1316
) -> None: ...
1417
def upload() -> None: ...
1518

@@ -20,13 +23,12 @@ class SampleHandle:
2023
def push_release(self, value: int, count: int) -> None: ...
2124
def push_alloc(self, value: int, count: int) -> None: ...
2225
def push_heap(self, value: int) -> None: ...
23-
def push_lock_name(self, lock_name: str) -> None: ...
24-
def push_frame(self, name: str, filename: str, address: int, line: int) -> None: ...
25-
def push_threadinfo(self, thread_id: int, thread_native_id: int, thread_name: Optional[str]) -> None: ...
26-
def push_taskinfo(self, task_id: int, task_name: str) -> None: ...
26+
def push_lock_name(self, lock_name: StringType) -> None: ...
27+
def push_frame(self, name: StringType, filename: StringType, address: int, line: int) -> None: ...
28+
def push_threadinfo(self, thread_id: int, thread_native_id: int, thread_name: StringType) -> None: ...
29+
def push_task_id(self, task_id: int) -> None: ...
30+
def push_task_name(self, task_name: StringType) -> None: ...
2731
def push_exceptioninfo(self, exc_type: type, count: int) -> None: ...
28-
def push_class_name(self, class_name: str) -> None: ...
29-
def push_span(self, span: typing.Optional[Span], endpoint_collection_enabled: bool) -> None: ...
30-
def flush_sample(
31-
self,
32-
) -> None: ...
32+
def push_class_name(self, class_name: StringType) -> None: ...
33+
def push_span(self, span: Optional[Span], endpoint_collection_enabled: bool) -> None: ...
34+
def flush_sample(self) -> None: ...

0 commit comments

Comments
 (0)