Repository navigation
chore(test-app): show what the SDK has stored for events - #427
Open
abelonogov-ld wants to merge 1 commit into
Open
abelonogov-ld wants to merge 1 commit into
abelonogov-ld wants to merge 1 commit into
Conversation
A text view under the persistence picker lists the event directory for this app and mobile key: the pending- logs processes append to and the ready- batches waiting for delivery, with the count each batch's name holds, their sizes and modification times. It reads names and sizes only, never opening a file, so looking cannot take a lock another process's recovery needs. It reads again every second while the app is in the foreground. A long press copies the directory's path. The directory comes from the SDK's own EventDirectory.defaultDirectory, through a class in the SDK's package as the benchmark runner does, so the view cannot drift from where the SDK writes. The iOS test app has the same section. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an Event storage view to the test app, as the iOS test app has: what the SDK has on disk for this app and mobile key.
Stacked on #408 (tier 3).
The view is a text block under the persistence picker. A summary line, "N log(s), N batch(es) holding N event(s)", is followed by the newest six files. Each line gives the file's kind (
log,new,batch), its shortened name, the event count a batch's name holds, its size and its modification time to the second:onResumetoonPause. A file that comes and goes within a second, such as anew-log being opened, is never shown.EventDirectory.defaultDirectoryis package-private, so a smallcom.launchdarkly.sdk.android.EventStorageLocationin the test app exposes it, the wayEventPersistenceBenchmarkRunneralready reaches into the package. The view cannot drift from where the SDK writes.Tested on an emulator (API 23):
ready-batches of 7 events each. That matchesadb shell run-as … ls -l no_backup/com.launchdarkly.events/<key>file for file.:test-app:assembleDebugbuilds.Note
Overview
The Android test app gains a live Event storage panel under the persistence picker, mirroring the iOS harness.
EventStorageInspectorresolves the SDK's on-disk events directory (via newEventStorageLocation, which delegates to package-privateEventDirectory.defaultDirectory) and refreshes a monospace summary once per second while the activity is foregrounded. It countspending-logs andready-batches, parses event counts from batch filenames, and lists the six newest files using metadata only (no file opens, so recovery locks stay untouched).MainActivitystarts/stops polling inonResume/onPauseand long-press copies the storage path. Layout addsstorage_status; the README documents the behavior.Reviewed by Cursor Bugbot for commit d73fc81. Bugbot is set up for automated code reviews on this repo. Configure here.