Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

Add utility to quickly check transcription sizes #64

Description

@jon-myers

Summary

When testing serialization changes (like the stripped-fields work in the serialization sync), it's useful to quickly see the JSON sizes of transcriptions in the database without fetching the full content.

Suggested Implementation

Add a method to SwaraClient that lists transcriptions with their approximate sizes, or fetches a batch of transcriptions and reports sizes. Something like:

client.get_transcription_sizes()
# Returns: [{'_id': '...', 'title': '...', 'size_bytes': 6941692, 'pitch_count': 6770}, ...]

This could either:

  1. Client-side: Fetch each transcription and measure len(json.dumps(data)) (slow but accurate)
  2. Server-side: Add an API endpoint that uses MongoDB's $bsonSize aggregation to report document sizes without transferring full content (fast, preferred)

Context

During serialization sync testing, we needed to find the largest transcription to verify size reduction percentages. Currently this requires fetching each transcription individually and measuring, which is slow for 145+ documents.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions