mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
core/rawdb: address comment from marius
This commit is contained in:
parent
1dcce45983
commit
2c08f8027f
2 changed files with 6 additions and 6 deletions
|
|
@ -216,9 +216,9 @@ func (batch *freezerTableBatch) commit() error {
|
||||||
batch.t.writeMeter.Mark(dataSize + indexSize)
|
batch.t.writeMeter.Mark(dataSize + indexSize)
|
||||||
|
|
||||||
// Periodically sync the table, todo (rjl493456442) make it configurable?
|
// Periodically sync the table, todo (rjl493456442) make it configurable?
|
||||||
batch.t.uncommit += items
|
batch.t.uncommitted += items
|
||||||
if batch.t.uncommit > freezerTableFlushThreshold && time.Since(batch.t.lastSync) > 30*time.Second {
|
if batch.t.uncommitted > freezerTableFlushThreshold && time.Since(batch.t.lastSync) > 30*time.Second {
|
||||||
batch.t.uncommit = 0
|
batch.t.uncommitted = 0
|
||||||
batch.t.lastSync = time.Now()
|
batch.t.lastSync = time.Now()
|
||||||
return batch.t.Sync()
|
return batch.t.Sync()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ type freezerTable struct {
|
||||||
headId uint32 // number of the currently active head file
|
headId uint32 // number of the currently active head file
|
||||||
tailId uint32 // number of the earliest file
|
tailId uint32 // number of the earliest file
|
||||||
|
|
||||||
metadata *freezerTableMeta // metadata of the table
|
metadata *freezerTableMeta // metadata of the table
|
||||||
uncommit uint64 // Count of items written without flushing to file
|
uncommitted uint64 // Count of items written without flushing to file
|
||||||
lastSync time.Time // Timestamp when the last sync was performed
|
lastSync time.Time // Timestamp when the last sync was performed
|
||||||
|
|
||||||
headBytes int64 // Number of bytes written to the head file
|
headBytes int64 // Number of bytes written to the head file
|
||||||
readMeter *metrics.Meter // Meter for measuring the effective amount of data read
|
readMeter *metrics.Meter // Meter for measuring the effective amount of data read
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue