proxystore.store.stats
Utilities for Tracking Stats on Store Operations.
Event ¶
TimeStats
dataclass
¶
Helper class for tracking time stats of an operation.
add_time ¶
Add a new time to the stats.
Parameters:
-
time_ms
(
float
) –Time (milliseconds) of a method execution.
-
size_bytes
(
int | None
) –Optionally note the data size associated with the operation that produced these statistics.
Source code in proxystore/store/stats.py
FunctionEventStats ¶
Bases: MutableMapping
Class for tracking stats of calls of functions that take a key.
Source code in proxystore/store/stats.py
keys ¶
wrap ¶
wrap(
function: GenericCallable,
*,
key_is_result: bool = False,
preset_key: NamedTuple | None = None
) -> GenericCallable
Wrap a method to log stats on calls to the function.
Parameters:
-
function
(
GenericCallable
) –Function to wrap.
-
key_is_result
(
bool
) –If
True
, the key is the return value offunction
rather than the first argument. -
preset_key
(
NamedTuple | None
) –Optionally preset the key associated with any calls to
function
. This overrideskey_is_returned
.
Returns:
-
GenericCallable
–Callable with same interface as
function
.