update procfs to v0.0.4 (#1457)
Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
parent
154d59dee7
commit
0b7ac85acb
8 changed files with 1514 additions and 174 deletions
200
vendor/github.com/prometheus/procfs/xfs/parse.go
generated
vendored
200
vendor/github.com/prometheus/procfs/xfs/parse.go
generated
vendored
|
|
@ -35,23 +35,25 @@ func ParseStats(r io.Reader) (*Stats, error) {
|
|||
fieldTrans = "trans"
|
||||
fieldIg = "ig"
|
||||
fieldLog = "log"
|
||||
fieldPushAil = "push_ail"
|
||||
fieldXstrat = "xstrat"
|
||||
fieldRw = "rw"
|
||||
fieldAttr = "attr"
|
||||
fieldIcluster = "icluster"
|
||||
fieldVnodes = "vnodes"
|
||||
fieldBuf = "buf"
|
||||
fieldXpc = "xpc"
|
||||
|
||||
fieldAbtb2 = "abtb2"
|
||||
fieldAbtc2 = "abtc2"
|
||||
fieldBmbt2 = "bmbt2"
|
||||
fieldIbt2 = "ibt2"
|
||||
//fieldFibt2 = "fibt2"
|
||||
fieldQm = "qm"
|
||||
fieldDebug = "debug"
|
||||
// Unimplemented at this time due to lack of documentation.
|
||||
// fieldPushAil = "push_ail"
|
||||
// fieldXstrat = "xstrat"
|
||||
// fieldAbtb2 = "abtb2"
|
||||
// fieldAbtc2 = "abtc2"
|
||||
// fieldBmbt2 = "bmbt2"
|
||||
// fieldIbt2 = "ibt2"
|
||||
// fieldFibt2 = "fibt2"
|
||||
// fieldQm = "qm"
|
||||
// fieldDebug = "debug"
|
||||
//fieldRmapbt = "rmapbt"
|
||||
//fieldRefcntbt = "refcntbt"
|
||||
|
||||
)
|
||||
|
||||
var xfss Stats
|
||||
|
|
@ -115,6 +117,23 @@ func ParseStats(r io.Reader) (*Stats, error) {
|
|||
xfss.Vnode, err = vnodeStats(us)
|
||||
case fieldBuf:
|
||||
xfss.Buffer, err = bufferStats(us)
|
||||
case fieldPushAil:
|
||||
xfss.PushAil, err = pushAilStats(us)
|
||||
case fieldXstrat:
|
||||
xfss.Xstrat, err = xStratStats(us)
|
||||
case fieldAbtb2:
|
||||
xfss.BtreeAllocBlocks2, err = btreeAllocBlocks2Stats(us)
|
||||
case fieldAbtc2:
|
||||
xfss.BtreeAllocContig2, err = btreeAllocContig2Stats(us)
|
||||
case fieldBmbt2:
|
||||
xfss.BtreeBlockMap2, err = btreeBlockMap2Stats(us)
|
||||
case fieldIbt2:
|
||||
xfss.BtreeInode2, err = btreeInode2Stats(us)
|
||||
//case fieldFibt2:
|
||||
case fieldQm:
|
||||
xfss.QuotaManager, err = quotaManagerStats(us)
|
||||
case fieldDebug:
|
||||
xfss.Debug, err = debugStats(us)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -228,7 +247,39 @@ func logOperationStats(us []uint32) (LogOperationStats, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// ReadWriteStats builds a ReadWriteStats from a slice of uint32s.
|
||||
// push_ail
|
||||
func pushAilStats(us []uint32) (PushAilStats, error) {
|
||||
if l := len(us); l != 10 {
|
||||
return PushAilStats{}, fmt.Errorf("incorrect number of values for XFS push ail stats: %d", l)
|
||||
}
|
||||
|
||||
return PushAilStats{
|
||||
TryLogspace: us[0],
|
||||
SleepLogspace: us[1],
|
||||
Pushes: us[2],
|
||||
Success: us[3],
|
||||
PushBuf: us[4],
|
||||
Pinned: us[5],
|
||||
Locked: us[6],
|
||||
Flushing: us[7],
|
||||
Restarts: us[8],
|
||||
Flush: us[9],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// xstrat
|
||||
func xStratStats(us []uint32) (XstratStats, error) {
|
||||
if l := len(us); l != 2 {
|
||||
return XstratStats{}, fmt.Errorf("incorrect number of values for XFS xstrat stats: %d", l)
|
||||
}
|
||||
|
||||
return XstratStats{
|
||||
Quick: us[0],
|
||||
Split: us[1],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// rw
|
||||
func readWriteStats(us []uint32) (ReadWriteStats, error) {
|
||||
if l := len(us); l != 2 {
|
||||
return ReadWriteStats{}, fmt.Errorf("incorrect number of values for XFS read write stats: %d", l)
|
||||
|
|
@ -328,3 +379,130 @@ func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) {
|
|||
ReadBytes: us[2],
|
||||
}, nil
|
||||
}
|
||||
|
||||
func quotaManagerStats(us []uint32) (QuotaManagerStats, error) {
|
||||
if l := len(us); l != 8 {
|
||||
return QuotaManagerStats{}, fmt.Errorf("incorrect number of values for XFS quota stats: %d", l)
|
||||
}
|
||||
|
||||
return QuotaManagerStats{
|
||||
Reclaims: us[0],
|
||||
ReclaimMisses: us[1],
|
||||
DquoteDups: us[2],
|
||||
CacheMisses: us[3],
|
||||
CacheHits: us[4],
|
||||
Wants: us[5],
|
||||
ShakeReclaims: us[6],
|
||||
InactReclaims: us[7],
|
||||
}, nil
|
||||
}
|
||||
|
||||
func debugStats(us []uint32) (DebugStats, error) {
|
||||
if l := len(us); l != 1 {
|
||||
return DebugStats{}, fmt.Errorf("incorrect number of values for XFS debug stats: %d", l)
|
||||
}
|
||||
|
||||
return DebugStats{
|
||||
Enabled: us[0],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// abtb2
|
||||
func btreeAllocBlocks2Stats(us []uint32) (BtreeAllocBlocks2Stats, error) {
|
||||
if l := len(us); l != 15 {
|
||||
return BtreeAllocBlocks2Stats{}, fmt.Errorf("incorrect number of values for abtb2 stats: %d", 1)
|
||||
}
|
||||
|
||||
return BtreeAllocBlocks2Stats{
|
||||
Lookup: us[0],
|
||||
Compare: us[1],
|
||||
Insrec: us[2],
|
||||
Delrec: us[3],
|
||||
NewRoot: us[4],
|
||||
KillRoot: us[5],
|
||||
Increment: us[6],
|
||||
Decrement: us[7],
|
||||
Lshift: us[8],
|
||||
Rshift: us[9],
|
||||
Split: us[10],
|
||||
Join: us[11],
|
||||
Alloc: us[12],
|
||||
Free: us[13],
|
||||
Moves: us[14],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// abtc2
|
||||
func btreeAllocContig2Stats(us []uint32) (BtreeAllocContig2Stats, error) {
|
||||
if l := len(us); l != 15 {
|
||||
return BtreeAllocContig2Stats{}, fmt.Errorf("incorrect number of values for abtc2 stats: %d", 1)
|
||||
}
|
||||
|
||||
return BtreeAllocContig2Stats{
|
||||
Lookup: us[0],
|
||||
Compare: us[1],
|
||||
Insrec: us[2],
|
||||
Delrec: us[3],
|
||||
NewRoot: us[4],
|
||||
KillRoot: us[5],
|
||||
Increment: us[6],
|
||||
Decrement: us[7],
|
||||
Lshift: us[8],
|
||||
Rshift: us[9],
|
||||
Split: us[10],
|
||||
Join: us[11],
|
||||
Alloc: us[12],
|
||||
Free: us[13],
|
||||
Moves: us[14],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// bmbt2
|
||||
func btreeBlockMap2Stats(us []uint32) (BtreeBlockMap2Stats, error) {
|
||||
if l := len(us); l != 15 {
|
||||
return BtreeBlockMap2Stats{}, fmt.Errorf("incorrect number of values for bmbt2 stats: %d", 1)
|
||||
}
|
||||
|
||||
return BtreeBlockMap2Stats{
|
||||
Lookup: us[0],
|
||||
Compare: us[1],
|
||||
Insrec: us[2],
|
||||
Delrec: us[3],
|
||||
NewRoot: us[4],
|
||||
KillRoot: us[5],
|
||||
Increment: us[6],
|
||||
Decrement: us[7],
|
||||
Lshift: us[8],
|
||||
Rshift: us[9],
|
||||
Split: us[10],
|
||||
Join: us[11],
|
||||
Alloc: us[12],
|
||||
Free: us[13],
|
||||
Moves: us[14],
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ibt2
|
||||
func btreeInode2Stats(us []uint32) (BtreeInode2Stats, error) {
|
||||
if l := len(us); l != 15 {
|
||||
return BtreeInode2Stats{}, fmt.Errorf("incorrect number of values for ibt2 stats: %d", 1)
|
||||
}
|
||||
|
||||
return BtreeInode2Stats{
|
||||
Lookup: us[0],
|
||||
Compare: us[1],
|
||||
Insrec: us[2],
|
||||
Delrec: us[3],
|
||||
NewRoot: us[4],
|
||||
KillRoot: us[5],
|
||||
Increment: us[6],
|
||||
Decrement: us[7],
|
||||
Lshift: us[8],
|
||||
Rshift: us[9],
|
||||
Split: us[10],
|
||||
Join: us[11],
|
||||
Alloc: us[12],
|
||||
Free: us[13],
|
||||
Moves: us[14],
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
121
vendor/github.com/prometheus/procfs/xfs/xfs.go
generated
vendored
121
vendor/github.com/prometheus/procfs/xfs/xfs.go
generated
vendored
|
|
@ -49,6 +49,14 @@ type Stats struct {
|
|||
Vnode VnodeStats
|
||||
Buffer BufferStats
|
||||
ExtendedPrecision ExtendedPrecisionStats
|
||||
Xstrat XstratStats // xstrat
|
||||
PushAil PushAilStats // push_ail
|
||||
Debug DebugStats // debug
|
||||
QuotaManager QuotaManagerStats // qm
|
||||
BtreeAllocBlocks2 BtreeAllocBlocks2Stats // abtb2
|
||||
BtreeAllocContig2 BtreeAllocContig2Stats // abtc2
|
||||
BtreeBlockMap2 BtreeBlockMap2Stats // bmbt2
|
||||
BtreeInode2 BtreeInode2Stats // ibt2
|
||||
}
|
||||
|
||||
// ExtentAllocationStats contains statistics regarding XFS extent allocations.
|
||||
|
|
@ -170,6 +178,119 @@ type ExtendedPrecisionStats struct {
|
|||
ReadBytes uint64
|
||||
}
|
||||
|
||||
// PushAilStats contains statistics on tail-pushing operations.
|
||||
type PushAilStats struct {
|
||||
TryLogspace uint32
|
||||
SleepLogspace uint32
|
||||
Pushes uint32
|
||||
Success uint32
|
||||
PushBuf uint32
|
||||
Pinned uint32
|
||||
Locked uint32
|
||||
Flushing uint32
|
||||
Restarts uint32
|
||||
Flush uint32
|
||||
}
|
||||
|
||||
// QuotaManagerStats contain statistics regarding quota processing.
|
||||
type QuotaManagerStats struct {
|
||||
Reclaims uint32
|
||||
ReclaimMisses uint32
|
||||
DquoteDups uint32
|
||||
CacheMisses uint32
|
||||
CacheHits uint32
|
||||
Wants uint32
|
||||
ShakeReclaims uint32
|
||||
InactReclaims uint32
|
||||
}
|
||||
|
||||
// XstratStats contains statistics regarding bytes processed by the XFS daemon.
|
||||
type XstratStats struct {
|
||||
Quick uint32
|
||||
Split uint32
|
||||
}
|
||||
|
||||
// DebugStats indicate if XFS debugging is enabled.
|
||||
type DebugStats struct {
|
||||
Enabled uint32
|
||||
}
|
||||
|
||||
// BtreeAllocBlocks2Stats contains statistics on B-Tree v2 allocations.
|
||||
type BtreeAllocBlocks2Stats struct {
|
||||
Lookup uint32
|
||||
Compare uint32
|
||||
Insrec uint32
|
||||
Delrec uint32
|
||||
NewRoot uint32
|
||||
KillRoot uint32
|
||||
Increment uint32
|
||||
Decrement uint32
|
||||
Lshift uint32
|
||||
Rshift uint32
|
||||
Split uint32
|
||||
Join uint32
|
||||
Alloc uint32
|
||||
Free uint32
|
||||
Moves uint32
|
||||
}
|
||||
|
||||
// BtreeAllocContig2Stats contain statistics on B-tree v2 free-space-by-size record operations.
|
||||
type BtreeAllocContig2Stats struct {
|
||||
Lookup uint32
|
||||
Compare uint32
|
||||
Insrec uint32
|
||||
Delrec uint32
|
||||
NewRoot uint32
|
||||
KillRoot uint32
|
||||
Increment uint32
|
||||
Decrement uint32
|
||||
Lshift uint32
|
||||
Rshift uint32
|
||||
Split uint32
|
||||
Join uint32
|
||||
Alloc uint32
|
||||
Free uint32
|
||||
Moves uint32
|
||||
}
|
||||
|
||||
// BtreeBlockMap2Stats contain statistics on B-tree v2 block map operations.
|
||||
type BtreeBlockMap2Stats struct {
|
||||
Lookup uint32
|
||||
Compare uint32
|
||||
Insrec uint32
|
||||
Delrec uint32
|
||||
NewRoot uint32
|
||||
KillRoot uint32
|
||||
Increment uint32
|
||||
Decrement uint32
|
||||
Lshift uint32
|
||||
Rshift uint32
|
||||
Split uint32
|
||||
Join uint32
|
||||
Alloc uint32
|
||||
Free uint32
|
||||
Moves uint32
|
||||
}
|
||||
|
||||
// BtreeInode2Stats contain statistics on B-tree v2 inode allocations.
|
||||
type BtreeInode2Stats struct {
|
||||
Lookup uint32
|
||||
Compare uint32
|
||||
Insrec uint32
|
||||
Delrec uint32
|
||||
NewRoot uint32
|
||||
KillRoot uint32
|
||||
Increment uint32
|
||||
Decrement uint32
|
||||
Lshift uint32
|
||||
Rshift uint32
|
||||
Split uint32
|
||||
Join uint32
|
||||
Alloc uint32
|
||||
Free uint32
|
||||
Moves uint32
|
||||
}
|
||||
|
||||
// FS represents the pseudo-filesystems proc and sys, which provides an interface to
|
||||
// kernel data structures.
|
||||
type FS struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue