Skip to content

Commit

Permalink
fix traffic by only requesting most recent for last insert ts (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsc authored Nov 16, 2022
1 parent 7c6070c commit 213338e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion db/bigtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ func (bigtable *Bigtable) SaveMachineMetric(process string, userID uint64, machi
}

func (bigtable *Bigtable) getLastMachineMetricInsertTs(ctx context.Context, rowKey string) (gcp_bigtable.Timestamp, error) {
row, err := bigtable.tableMachineMetrics.ReadRow(ctx, rowKey)
filter := gcp_bigtable.ChainFilters(
gcp_bigtable.FamilyFilter(MACHINE_METRICS_COLUMN_FAMILY),
gcp_bigtable.LatestNFilter(1),
)

row, err := bigtable.tableMachineMetrics.ReadRow(ctx, rowKey, gcp_bigtable.RowFilter(filter))
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 213338e

Please sign in to comment.