1
0
Fork 0

Merge pull request #660 from rqlite/add_log_size

Add Raft log size on disk to status
master
Philip O'Toole 4 years ago committed by GitHub
commit 299e0e683e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,7 @@
## 5.4.1 (unreleased)
## New features
- [PR #660](https://github.com/rqlite/rqlite/pull/660): Raft log size on disk now reported via status endpoint.
## 5.4.0 (June 14th 2020) ## 5.4.0 (June 14th 2020)
### New features ### New features

@ -16,6 +16,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"sort" "sort"
"strconv"
"sync" "sync"
"time" "time"
@ -430,9 +431,16 @@ func (s *Store) Stats() (map[string]interface{}, error) {
return nil, err return nil, err
} }
raftStats := s.raft.Stats()
ls, err := s.logSize()
if err != nil {
return nil, err
}
raftStats["log_size"] = strconv.FormatInt(ls, 10)
status := map[string]interface{}{ status := map[string]interface{}{
"node_id": s.raftID, "node_id": s.raftID,
"raft": s.raft.Stats(), "raft": raftStats,
"addr": s.Addr(), "addr": s.Addr(),
"leader": map[string]string{ "leader": map[string]string{
"node_id": leaderID, "node_id": leaderID,

Loading…
Cancel
Save