@@ -54,10 +54,10 @@ def get(
54
54
self ,
55
55
request : Request ,
56
56
project : Project ,
57
- uptime_subscription : ProjectUptimeSubscription ,
57
+ uptime_monitor : ProjectUptimeSubscription ,
58
58
) -> Response :
59
59
60
- if uptime_subscription .uptime_subscription .subscription_id is None :
60
+ if uptime_monitor .uptime_subscription .subscription_id is None :
61
61
return Response ([])
62
62
63
63
start , end = get_date_range_from_params (request .GET )
@@ -71,7 +71,7 @@ def data_fn(offset: int, limit: int) -> Any:
71
71
):
72
72
return self ._make_eap_request (
73
73
project ,
74
- uptime_subscription ,
74
+ uptime_monitor ,
75
75
offset ,
76
76
limit ,
77
77
start ,
@@ -83,7 +83,7 @@ def data_fn(offset: int, limit: int) -> Any:
83
83
else :
84
84
return self ._make_eap_request (
85
85
project ,
86
- uptime_subscription ,
86
+ uptime_monitor ,
87
87
offset ,
88
88
limit ,
89
89
start ,
@@ -107,7 +107,7 @@ def data_fn(offset: int, limit: int) -> Any:
107
107
def _make_eap_request (
108
108
self ,
109
109
project : Project ,
110
- uptime_subscription : ProjectUptimeSubscription ,
110
+ uptime_monitor : ProjectUptimeSubscription ,
111
111
offset : int ,
112
112
limit : int ,
113
113
start : datetime ,
@@ -129,11 +129,9 @@ def _make_eap_request(
129
129
end_timestamp .FromDatetime (end )
130
130
131
131
if trace_item_type == TraceItemType .TRACE_ITEM_TYPE_UPTIME_CHECK :
132
- subscription_id = str (
133
- uuid .UUID (uptime_subscription .uptime_subscription .subscription_id )
134
- )
132
+ subscription_id = str (uuid .UUID (uptime_monitor .uptime_subscription .subscription_id ))
135
133
else :
136
- subscription_id = uuid .UUID (uptime_subscription .uptime_subscription .subscription_id ).hex
134
+ subscription_id = uuid .UUID (uptime_monitor .uptime_subscription .subscription_id ).hex
137
135
138
136
subscription_filter = TraceItemFilter (
139
137
comparison_filter = ComparisonFilter (
@@ -202,12 +200,12 @@ def _make_eap_request(
202
200
)
203
201
204
202
rpc_response = snuba_rpc .table_rpc ([rpc_request ])[0 ]
205
- return self ._serialize_response (rpc_response , uptime_subscription , trace_item_type )
203
+ return self ._serialize_response (rpc_response , uptime_monitor , trace_item_type )
206
204
207
205
def _serialize_response (
208
206
self ,
209
207
rpc_response : TraceItemTableResponse ,
210
- uptime_subscription : ProjectUptimeSubscription ,
208
+ uptime_monitor : ProjectUptimeSubscription ,
211
209
trace_item_type : TraceItemType .ValueType ,
212
210
) -> list [EapCheckEntrySerializerResponse ]:
213
211
"""
@@ -220,7 +218,7 @@ def _serialize_response(
220
218
column_names = [cv .attribute_name for cv in column_values ]
221
219
entries : list [EapCheckEntry ] = [
222
220
self ._transform_row (
223
- row_idx , column_values , column_names , uptime_subscription , trace_item_type
221
+ row_idx , column_values , column_names , uptime_monitor , trace_item_type
224
222
)
225
223
for row_idx in range (len (column_values [0 ].results ))
226
224
]
@@ -232,7 +230,7 @@ def _transform_row(
232
230
row_idx : int ,
233
231
column_values : Any ,
234
232
column_names : list [str ],
235
- uptime_subscription : ProjectUptimeSubscription ,
233
+ uptime_monitor : ProjectUptimeSubscription ,
236
234
trace_item_type : TraceItemType .ValueType ,
237
235
) -> EapCheckEntry :
238
236
row_dict : dict [str , AttributeValue ] = {
@@ -259,7 +257,7 @@ def _transform_row(
259
257
260
258
return EapCheckEntry (
261
259
uptime_check_id = uptime_check_id ,
262
- uptime_monitor_id = uptime_subscription .id ,
260
+ uptime_monitor_id = uptime_monitor .id ,
263
261
timestamp = datetime .fromtimestamp (
264
262
row_dict [
265
263
(
0 commit comments