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: object

A completed read and the bytes it returned.

path: str
offset: int
length: int | None
data: bytes
class synology_apm_repo.sdk.storage.recording.SizeCall(path, size)

Bases: object

A completed size.

path: str
size: int
class synology_apm_repo.sdk.storage.recording.ExistsCall(path, found)

Bases: object

A completed exists.

path: str
found: bool
class synology_apm_repo.sdk.storage.recording.ListCall(path, entries)

Bases: object

A completed listdir.

path: str
entries: list[Entry]
class synology_apm_repo.sdk.storage.recording.FailedCall(method, path, offset, length, error)

Bases: object

A call that raised error; offset/length are 0/None for every method but read.

method: str
path: str
offset: int
length: int | None
error: Exception
class synology_apm_repo.sdk.storage.recording.InstrumentedStore(backing)

Bases: ABC

Forwards each ObjectStore method to backing unchanged and hands every completed call to _observe and every failed one (an Exception, not a cancellation) to _observe_failure, with its wall-clock elapsed seconds and started epoch 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’s close(), so Session.close() still releases a wrapped S3Store/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: object

One ObjectStore call, for the --trace CLI flag.

Variables:
  • method (str) – "read", "size", "exists", or "listdir".

  • path (str) – Store-relative path the call targeted.

  • offset (int) – read’s byte offset; 0 for every other method.

  • length (int | None) – read’s requested length; None for every other method.

  • result_length (int | None) – Bytes actually returned (read) or entries listed (listdir); None for size/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); None when it succeeded.

method: str
path: str
offset: int
length: int | None
result_length: int | None
elapsed: float
started: float
error: str | None
class synology_apm_repo.sdk.storage.recording.TracingStore(backing, on_event)

Bases: InstrumentedStore

Wraps a real ObjectStore, calling on_event with a TraceEvent per call, failed ones included. Results and exceptions pass through unchanged.

property backing: ObjectStore

The real store this instance forwards to, so Session can recognize two wraps of one connector as a single resource.