Implement the Callback Method:
Implement the recordConfirmedQueueSize method to update the gauge value in submitter.go:
func (t *txSubmitterImpl) recordConfirmedQueueSize(ctx context.Context, result metric.Int64ObserverResult) {
size, err := t.db.GetConfirmedQueueSize(ctx, t.signer.Address())
if err != nil {
logger.Errorf("could not get confirmed queue size: %v", err)
return
}
result.Observe(int64(size))
}
Update the Database Interface:
Ensure the db.Service interface has the GetConfirmedQueueSize method in db.go:
type Service interface {
// ... existing methods ...
GetConfirmedQueueSize(ctx context.Context, address common.Address) (int, error)
}
Implement the Database Method:
Implement the GetConfirmedQueueSize method in the database service implementation in db.go:
func (d *dbService) GetConfirmedQueueSize(ctx context.Context, address common.Address) (int, error) {
// Implement the logic to count the confirmed transactions in the queue
}
#### About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a ๐ if this is helpful and ๐ if it is irrelevant.
[Ask Greptile](https://app.greptile.com/chat/github/synapsecns/sanguine/master) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
To implement a confirmed queue gauge in the
submitter
package, follow these steps:Define the Gauge in
txSubmitterImpl
struct: Add a new field for the confirmed queue gauge in thetxSubmitterImpl
struct insubmitter.go
:Initialize the Gauge in
setupMetrics
: Initialize the confirmed queue gauge in thesetupMetrics
method insubmitter.go
:Implement the Callback Method: Implement the
recordConfirmedQueueSize
method to update the gauge value insubmitter.go
:Update the Database Interface: Ensure the
db.Service
interface has theGetConfirmedQueueSize
method indb.go
:Implement the Database Method: Implement the
GetConfirmedQueueSize
method in the database service implementation indb.go
:References
/ethergo/submitter/submitter.go /ethergo/submitter/queue.go
#### About Greptile
This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐ if this is helpful and ๐ if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/synapsecns/sanguine/master) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)