synology_apm_repo.sdk.storage.recording module¶
InstrumentedStore: an ObjectStore wrapper that hands every call
to its subclass as a typed call event. TracingStore (the CLI’s
--trace flag) is one.
- class synology_apm_repo.sdk.storage.recording.ReadCall(path, offset, length, data)¶
Bases:
objectA completed
readand the bytes it returned.
- class synology_apm_repo.sdk.storage.recording.ExistsCall(path, found)¶
Bases:
objectA completed
exists.
- class synology_apm_repo.sdk.storage.recording.ListCall(path, entries)¶
Bases:
objectA completed
listdir.
- class synology_apm_repo.sdk.storage.recording.FailedCall(method, path, offset, length, error)¶
Bases:
objectA call that raised
error;offset/lengthare0/Nonefor every method butread.
- class synology_apm_repo.sdk.storage.recording.InstrumentedStore(backing)¶
Bases:
ABCForwards each
ObjectStoremethod tobackingunchanged and hands every completed call to_observeand every failed one (anException, not a cancellation) to_observe_failure, with its wall-clockelapsedseconds andstartedepoch time; the failure is then re-raised unchanged.- async read(path, offset=0, length=None)¶
- async size(path)¶
- async exists(path)¶
- async listdir(path)¶
- async close()¶
Forward to
backing’sclose(), soSession.close()still releases a wrappedS3Store/AzureStore.
- class synology_apm_repo.sdk.storage.recording.TraceEvent(method, path, offset=0, length=None, result_length=None, elapsed=0.0, started=0.0, error=None)¶
Bases:
objectOne
ObjectStorecall, for the--traceCLI flag.- Variables:
method (str) –
"read","size","exists", or"listdir".path (str) – Store-relative path the call targeted.
offset (int) –
read’s byte offset;0for every other method.length (int | None) –
read’s requested length;Nonefor every other method.result_length (int | None) – Bytes actually returned (
read) or entries listed (listdir);Noneforsize/exists, which report a plain value rather than a count.elapsed (float) – Wall-clock seconds the call took.
started (float) – Epoch seconds (
time.time()) at which the call began.error (str | None) – The exception class name when the call failed (it is re-raised unchanged);
Nonewhen it succeeded.
- class synology_apm_repo.sdk.storage.recording.TracingStore(backing, on_event)¶
Bases:
InstrumentedStoreWraps a real
ObjectStore, callingon_eventwith aTraceEventper call, failed ones included. Results and exceptions pass through unchanged.- property backing: ObjectStore¶
The real store this instance forwards to, so
Sessioncan recognize two wraps of one connector as a single resource.