-
Notifications
You must be signed in to change notification settings - Fork 17
Add State Store Metrics #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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