-
Notifications
You must be signed in to change notification settings - Fork 18
Add State Store Metrics #119
base: main
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| func (b *Batch) Write() (err error) { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } | ||
|
|
||
| func (b *RawBatch) Write() (err error) { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } | ||
|
|
||
| // Start background metrics collection | ||
| go database.collectMetricsInBackground() |
Check notice
Code scanning / CodeQL
Spawning a Go routine Note
| } | ||
|
|
||
| func (db *Database) Get(storeKey string, targetVersion int64, key []byte) ([]byte, error) { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } | ||
|
|
||
| func (db *Database) ApplyChangeset(version int64, cs *proto.NamedChangeSet) error { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| } | ||
|
|
||
| func (db *Database) computeHashForRange(beginBlock, endBlock int64) error { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| // it has been updated. This occurs when that module's keys are updated in between pruning runs, the node after is restarted. | ||
| // This is not a large issue given the next time that module is updated, it will be properly pruned thereafter. | ||
| func (db *Database) Prune(version int64) error { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| // Import loads the initial version of the state in parallel with numWorkers goroutines | ||
| // TODO: Potentially add retries instead of panics | ||
| func (db *Database) Import(version int64, ch <-chan types.SnapshotNode) error { | ||
| startTime := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
|
|
||
| // Record compaction duration if available | ||
| if compactionCountDelta > 0 && m.Compact.Duration > 0 { | ||
| avgDurationSeconds := m.Compact.Duration.Seconds() / float64(compactionCountDelta) |
Check notice
Code scanning / CodeQL
Floating point arithmetic Note
|
|
||
| // Record flush duration if available | ||
| if flushCountDelta > 0 && m.Flush.WriteThroughput.WorkDuration > 0 { | ||
| avgDurationSeconds := m.Flush.WriteThroughput.WorkDuration.Seconds() / float64(flushCountDelta) |
Check notice
Code scanning / CodeQL
Floating point arithmetic Note
Describe your changes and provide context
Testing performed to validate your change