diff --git a/src/utils/mutateInternal.ts b/src/utils/mutateInternal.ts index f068543cf..164db7a78 100644 --- a/src/utils/mutateInternal.ts +++ b/src/utils/mutateInternal.ts @@ -32,6 +32,18 @@ import * as is from 'is'; import {Mutation} from '../mutation'; import arrify = require('arrify'); +/** + * Applies a set of changes to be atomically applied to the specified row(s). + * Mutations are applied in order, meaning that earlier mutations can be masked + * by later ones. This internal function handles the retry logic and metrics collection + * for the mutate operation. + * + * @param {TabularApiSurface} table The table or authorized view to perform the mutation on. + * @param {OperationMetricsCollector} metricsCollector The metrics collector for the operation. + * @param {Entry | Entry[]} entriesRaw List of entities to be inserted or deleted. + * @param {MutateOptions | MutateCallback} [optionsOrCallback] Configuration object or callback function. + * @param {MutateCallback} [cb] The callback function. + */ export function mutateInternal( table: TabularApiSurface, metricsCollector: OperationMetricsCollector, diff --git a/system-test/client-side-metrics-all-methods.ts b/system-test/client-side-metrics-all-methods.ts index a10d71af3..882242833 100644 --- a/system-test/client-side-metrics-all-methods.ts +++ b/system-test/client-side-metrics-all-methods.ts @@ -92,7 +92,7 @@ function checkFirstResponseLatency(requestHandled: OnOperationCompleteData) { delete requestHandled.firstResponseLatency; } -function readRowsAssertionCheck( +function metricsAssertionCheck( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], method: string, @@ -207,7 +207,7 @@ function checkMultiRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRows', @@ -219,7 +219,7 @@ function checkMutateRowsCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRows', @@ -243,7 +243,7 @@ function checkMutateRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRow', @@ -255,7 +255,7 @@ function checkSingleRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRow',