Skip to content

Commit 00ed2de

Browse files
committed
Fix bucket report comments and collection typing
1 parent 348d152 commit 00ed2de

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ export abstract class MongoSyncBucketStorage
581581
* when the whole bucket was read, otherwise estimated via {@link storage.estimateDistinctRows}); fragmentation is
582582
* then `operations / rows`.
583583
*/
584-
protected async estimateRowsFromOperationSample(
585-
collection: mongo.Collection<any>,
584+
protected async estimateRowsFromOperationSample<T extends mongo.Document>(
585+
collection: mongo.Collection<T>,
586586
pipelinePrefix: mongo.Document[],
587587
operations: number,
588588
sampled: boolean

packages/service-core/src/routes/endpoints/admin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ export const validate = routeDefinition({
271271
/**
272272
* Per-bucket report of total operations vs total live rows in storage, for the active sync config.
273273
*
274-
* Answers the recurring "why is my Data Synced so high" question instance-wide
275-
* a high `operations / rows` ratio indicates fragmented buckets that a compact or
276-
* defragment can reclaim.
274+
* Answers the recurring "why is my Data Synced so high" question. A high `operations / rows` ratio
275+
* indicates fragmented buckets that a compact or defragment can reclaim.
277276
*/
278277
export const bucketReport = routeDefinition({
279278
path: '/api/admin/v1/bucket-report',

packages/service-core/src/storage/SyncRulesBucketStorage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ export interface SyncRulesBucketStorage
173173
* Per-bucket report of total operations vs total live rows in storage.
174174
*
175175
* Intended for an on-demand admin/diagnostics view (e.g. answering "why is my Data Synced so high"),
176-
* not as a live gauge. Operation and live-row counts are aggregated from storage; the exact source is
177-
* backend-specific (MongoDB reads pre-aggregated bucket state, Postgres scans bucket data). May be
176+
* not as a live gauge. How the counts are derived is backend-specific, and the report may be relatively
178177
* expensive on large instances.
179178
*
180179
* Optional: storage providers that don't implement it are reported as unsupported by the API.

0 commit comments

Comments
 (0)