File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/sentry/runner/commands Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
+ import time
2
3
from typing import Any
3
4
4
5
import click
@@ -120,6 +121,7 @@ def configoptions(
120
121
from sentry import options
121
122
122
123
ctx .obj ["dry_run" ] = dry_run
124
+ ctx .obj ["timestamp" ] = timestamp
123
125
124
126
with open (file ) if file is not None else sys .stdin as stream :
125
127
options_to_update = safe_load (stream )
@@ -216,6 +218,13 @@ def patch(ctx: click.Context) -> None:
216
218
tags = {"status" : status },
217
219
sample_rate = 1.0 ,
218
220
)
221
+ if ctx .obj ["timestamp" ] is not None :
222
+ metrics .distribution (
223
+ key = "options_automator.latency_seconds" ,
224
+ value = time .time () - ctx .obj ["timestamp" ],
225
+ tags = {"status" : status },
226
+ sample_rate = 1.0 ,
227
+ )
219
228
exit (ret_val )
220
229
221
230
@@ -311,5 +320,12 @@ def sync(ctx: click.Context) -> None:
311
320
tags = {"status" : status },
312
321
sample_rate = 1.0 ,
313
322
)
323
+ if ctx .obj ["timestamp" ] is not None :
324
+ metrics .distribution (
325
+ key = "options_automator.latency_seconds" ,
326
+ value = time .time () - ctx .obj ["timestamp" ],
327
+ tags = {"status" : status },
328
+ sample_rate = 1.0 ,
329
+ )
314
330
315
331
exit (ret_val )
You can’t perform that action at this time.
0 commit comments