@@ -65,7 +65,9 @@ func TestRecordTransaction(t *testing.T) {
6565 nil ,
6666 )
6767 // Record a transaction, ensure no insights are generated.
68- require .NoError (t , memContainer .RecordTransaction (ctx , appstatspb .TransactionFingerprintID (123 ), sqlstats.RecordedTxnStats {}))
68+ require .NoError (t , memContainer .RecordTransaction (ctx , sqlstats.RecordedTxnStats {
69+ FingerprintID : appstatspb .TransactionFingerprintID (123 ),
70+ }))
6971 })
7072}
7173
@@ -122,6 +124,7 @@ func TestContainer_Add(t *testing.T) {
122124 // Add some transaction stats to the source container
123125 txnFingerprintID := appstatspb .TransactionFingerprintID (123 )
124126 txnStats := sqlstats.RecordedTxnStats {
127+ FingerprintID : txnFingerprintID ,
125128 RowsAffected : 10 ,
126129 ServiceLatency : 1 ,
127130 RetryLatency : 2 ,
@@ -132,7 +135,7 @@ func TestContainer_Add(t *testing.T) {
132135 RowsWritten : 5 ,
133136 BytesRead : 100 ,
134137 }
135- require .NoError (t , src .RecordTransaction (ctx , txnFingerprintID , txnStats ))
138+ require .NoError (t , src .RecordTransaction (ctx , txnStats ))
136139
137140 // In the src destination, these 'reduced' entries will have
138141 // 0 values.
@@ -159,6 +162,7 @@ func TestContainer_Add(t *testing.T) {
159162 }
160163 reducedTxnFingerprintID := appstatspb .TransactionFingerprintID (321 )
161164 reducedTxnStats := sqlstats.RecordedTxnStats {
165+ FingerprintID : reducedTxnFingerprintID ,
162166 RowsAffected : 100 ,
163167 ServiceLatency : 500 * time .Millisecond ,
164168 RetryLatency : 100 * time .Millisecond ,
@@ -170,11 +174,13 @@ func TestContainer_Add(t *testing.T) {
170174 BytesRead : 100 ,
171175 }
172176 require .NoError (t , dest .RecordStatement (ctx , reducedStmtStats ))
173- require .NoError (t , dest .RecordTransaction (ctx , reducedTxnFingerprintID , reducedTxnStats ))
177+ require .NoError (t , dest .RecordTransaction (ctx , reducedTxnStats ))
174178 require .NoError (t , src .RecordStatement (ctx , sqlstats.RecordedStmtStats {
175179 FingerprintID : appstatspb .StmtFingerprintID (321 ),
176180 }))
177- require .NoError (t , src .RecordTransaction (ctx , reducedTxnFingerprintID , sqlstats.RecordedTxnStats {}))
181+ require .NoError (t , src .RecordTransaction (ctx , sqlstats.RecordedTxnStats {
182+ FingerprintID : reducedTxnFingerprintID ,
183+ }))
178184
179185 for i := 0 ; i < 10 ; i ++ {
180186 require .NoError (t , dest .Add (ctx , src ))
@@ -316,10 +322,11 @@ func TestContainerMemoryAccountClearing(t *testing.T) {
316322 require .NoError (t , err )
317323
318324 // Record a transaction to allocate more memory.
319- txnKey := appstatspb .TransactionFingerprintID (100 )
320- txnStats := sqlstats.RecordedTxnStats {}
325+ txnStats := sqlstats.RecordedTxnStats {
326+ FingerprintID : appstatspb .TransactionFingerprintID (100 ),
327+ }
321328
322- err = container .RecordTransaction (ctx , txnKey , txnStats )
329+ err = container .RecordTransaction (ctx , txnStats )
323330 require .NoError (t , err )
324331
325332 // Verify memory is allocated
0 commit comments