| 12345678910111213141516 |
- package raft
- // GetLogSize returns the current size of the log file in bytes
- func (lm *LogManager) GetLogSize() int64 {
- lm.mu.RLock()
- defer lm.mu.RUnlock()
- if hs, ok := lm.storage.(*HybridStorage); ok {
- info, err := hs.logFile.Stat()
- if err == nil {
- return info.Size()
- }
- }
- return 0
- }
|