|
| 1 | +import typing |
| 2 | + |
| 3 | +import typing_extensions |
| 4 | + |
| 5 | +BreakpointEntry = typing_extensions.TypedDict( |
| 6 | + "BreakpointEntry", |
| 7 | + { |
| 8 | + "project": str, |
| 9 | + "transaction": str, |
| 10 | + "aggregate_range_1": float, |
| 11 | + "aggregate_range_2": float, |
| 12 | + "unweighted_t_value": float, |
| 13 | + "unweighted_p_value": float, |
| 14 | + "trend_percentage": float, |
| 15 | + "absolute_percentage_change": float, |
| 16 | + "trend_difference": float, |
| 17 | + "breakpoint": int, |
| 18 | + "request_start": int, |
| 19 | + "request_end": int, |
| 20 | + "data_start": int, |
| 21 | + "data_end": int, |
| 22 | + "change": typing.Union[typing.Literal["improvement"], typing.Literal["regression"]], |
| 23 | + }, |
| 24 | + total=False, |
| 25 | +) |
| 26 | + |
| 27 | +BreakpointRequest = typing_extensions.TypedDict( |
| 28 | + "BreakpointRequest", |
| 29 | + { |
| 30 | + "data": typing.Mapping[str, "BreakpointTransaction"], |
| 31 | + # default: '' |
| 32 | + "sort": str, |
| 33 | + # default: '1' |
| 34 | + "allow_midpoint": str, |
| 35 | + # default: 0 |
| 36 | + "validate_tail_hours": int, |
| 37 | + # default: 0.1 |
| 38 | + "trend_percentage()": float, |
| 39 | + # default: 0.0 |
| 40 | + "min_change()": float, |
| 41 | + }, |
| 42 | + total=False, |
| 43 | +) |
| 44 | + |
| 45 | +BreakpointResponse = typing_extensions.TypedDict( |
| 46 | + "BreakpointResponse", |
| 47 | + { |
| 48 | + "data": typing.List["BreakpointEntry"], |
| 49 | + }, |
| 50 | + total=False, |
| 51 | +) |
| 52 | + |
| 53 | +BreakpointTransaction = typing_extensions.TypedDict( |
| 54 | + "BreakpointTransaction", |
| 55 | + { |
| 56 | + "data": typing.List[typing.Tuple[int, typing.Tuple["SnubaMetadata"]]], |
| 57 | + "request_start": int, |
| 58 | + "request_end": int, |
| 59 | + "data_start": int, |
| 60 | + "data_end": int, |
| 61 | + }, |
| 62 | + total=False, |
| 63 | +) |
| 64 | + |
| 65 | +SeverityRequest = typing_extensions.TypedDict( |
| 66 | + "SeverityRequest", |
| 67 | + { |
| 68 | + # default: '' |
| 69 | + "message": str, |
| 70 | + # default: 0 |
| 71 | + "has_stacktrace": int, |
| 72 | + # default: False |
| 73 | + "handled": bool, |
| 74 | + "trigger_timeout": typing.Union[bool, None], |
| 75 | + "trigger_error": typing.Union[bool, None], |
| 76 | + }, |
| 77 | + total=False, |
| 78 | +) |
| 79 | + |
| 80 | +SeverityResponse = typing_extensions.TypedDict( |
| 81 | + "SeverityResponse", |
| 82 | + { |
| 83 | + # default: 0.0 |
| 84 | + "severity": float, |
| 85 | + }, |
| 86 | + total=False, |
| 87 | +) |
| 88 | + |
| 89 | +SnubaMetadata = typing_extensions.TypedDict( |
| 90 | + "SnubaMetadata", |
| 91 | + { |
| 92 | + "count": int, |
| 93 | + }, |
| 94 | + total=False, |
| 95 | +) |
0 commit comments