Class DittoDiskUsage
Provides access to information about disk storage used by Ditto.
This class allows you to query current disk usage and observe changes over time.
Access an instance through Ditto.getDiskUsage().
- API Note:
- Do not implement this interface yourself.
-
Method Summary
Modifier and TypeMethodDescription@NonNull DittoDiskUsageItemReturns a single snapshot of current disk usage.@NonNull Flow.Publisher<DittoDiskUsageItem> observe()Observes disk usage changes using a reactive streams publisher.@NonNull AutoCloseableobserve(@NonNull DittoDiskUsageCallback callback) Observes disk usage changes using a callback.
-
Method Details
-
getCurrent
Returns a single snapshot of current disk usage.
This provides an immediate, point-in-time view of how much disk space is being used by Ditto's data store, including documents, attachments, and metadata.
- Returns:
- a
DittoDiskUsageItemcontaining current disk usage information.
-
observe
Observes disk usage changes using a callback.
The callback will be invoked regularly with updated disk usage information. Observation continues until the returned
AutoCloseablehandle goes out of scope or itsAutoCloseable.close()method is invoked.- Parameters:
callback- theDittoDiskUsageCallbackto be called withDittoDiskUsageItemupdates.- Returns:
- an
AutoCloseablehandle to stop observing disk usage.
-
observe
Observes disk usage changes using a reactive streams publisher.
Returns a
Flow.Publisherthat emitsDittoDiskUsageItemupdates regularly as disk usage changes. Use this method when integrating with reactive streams frameworks.- Returns:
- a
Flow.Publisherthat emits disk usage updates.
-