Skip to content
8 changes: 6 additions & 2 deletions handwritten/bigtable/src/client-side-metrics/exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ function getInterval(
const startSec = dataPoint.startTime[0];
const startNanos = dataPoint.startTime[1];

if (startSec > endSec || (startSec === endSec && startNanos > endNanos)) {
if (startSec > endSec || (startSec === endSec && startNanos >= endNanos)) {
endSec = startSec;
endNanos = startNanos;
endNanos = startNanos + 1_000_000;
if (endNanos >= 1_000_000_000) {
endSec += 1;
endNanos -= 1_000_000_000;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifying the timestamps for our metrics does not seem like something we should do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, I can see we already made changes in danieljbruce@1ea27c9 to artificially change the end and start nanos and it seems the problem with that change is that it is setting the endNanos to the startNanos which is still causing errors. In other words, setting endNanos to startNanos didn't really solve the flakey tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is possible, we should really try to revert the change from the previous PR and fix the tests only with test changes if possible.

}

return {
Expand Down
9 changes: 3 additions & 6 deletions handwritten/bigtable/src/utils/mutateInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {
Entry,
MutateCallback,
MutateOptions,
PartialFailureError,
} from '../table';
import {Entry, MutateOptions} from '../table';
import {OperationMetricsCollector} from '../client-side-metrics/operation-metrics-collector';
import {
DEFAULT_BACKOFF_SETTINGS,
getNextDelay,
MutateCallback,
PartialFailureError,
populateAttemptHeader,
RETRYABLE_STATUS_CODES,
TabularApiSurface,
Expand Down Expand Up @@ -189,7 +186,7 @@
// Handling retries in this client. Specify the retry options to
// make sure nothing is retried in retry-request.
noResponseRetries: 0,
shouldRetryFn: (_: any) => {

Check warning on line 189 in handwritten/bigtable/src/utils/mutateInternal.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 189 in handwritten/bigtable/src/utils/mutateInternal.ts

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used
return false;
},
};
Expand Down
Loading
Loading