File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ fn convert_metric_event<'p>(
257
257
} ,
258
258
} ,
259
259
)
260
- . unwrap ( ) ,
260
+ . expect ( "Unable to create buffered metric" ) ,
261
261
) ;
262
262
populate_into. set ( Arc :: new ( buffered_ref) ) . unwrap ( ) ;
263
263
None
@@ -275,11 +275,11 @@ fn convert_metric_event<'p>(
275
275
. clone ( )
276
276
. as_any ( )
277
277
. downcast :: < BufferedMetricAttributes > ( )
278
- . unwrap ( )
278
+ . expect ( "Unable to downcast to expected buffered metric attributes" )
279
279
. 0
280
280
. as_ref ( py)
281
281
. copy ( )
282
- . unwrap ( )
282
+ . expect ( "Failed to copy metric attribute dictionary" )
283
283
. into ( ) ,
284
284
None => PyDict :: new ( py) . into ( ) ,
285
285
} ;
@@ -292,12 +292,12 @@ fn convert_metric_event<'p>(
292
292
metrics:: MetricValue :: Float ( v) => new_attrs. set_item ( kv. key , v) ,
293
293
metrics:: MetricValue :: Bool ( v) => new_attrs. set_item ( kv. key , v) ,
294
294
}
295
- . unwrap ( ) ;
295
+ . expect ( "Unable to set metric key/value on dictionary" ) ;
296
296
}
297
297
// Put on lazy ref
298
298
populate_into
299
299
. set ( Arc :: new ( BufferedMetricAttributes ( new_attrs_ref) ) )
300
- . unwrap ( ) ;
300
+ . expect ( "Unable to set buffered metric attributes on reference" ) ;
301
301
None
302
302
}
303
303
// Convert to Python metric event
@@ -316,7 +316,7 @@ fn convert_metric_event<'p>(
316
316
. clone ( )
317
317
. as_any ( )
318
318
. downcast :: < BufferedMetricAttributes > ( )
319
- . unwrap ( )
319
+ . expect ( "Unable to downcast to expected buffered metric attributes" )
320
320
. 0
321
321
. clone ( ) ,
322
322
} ) ,
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ impl RuntimeRef {
134
134
self . runtime
135
135
. metrics_call_buffer
136
136
. as_ref ( )
137
- . unwrap ( )
137
+ . expect ( "Attempting to retrieve buffered metrics without buffer" )
138
138
. retrieve ( ) ,
139
139
)
140
140
}
Original file line number Diff line number Diff line change @@ -197,7 +197,8 @@ def __init__(self, buffer_size: int) -> None:
197
197
and is drained regularly. See :py:class:`MetricBuffer` warning.
198
198
199
199
Args:
200
- buffer_size: Size of the buffer. Set this to a large value.
200
+ buffer_size: Size of the buffer. Set this to a large value. A value
201
+ in the tens of thousands or higher is plenty reasonable.
201
202
"""
202
203
self ._buffer_size = buffer_size
203
204
self ._runtime : Optional [Runtime ] = None
You can’t perform that action at this time.
0 commit comments