diff --git a/go.mod b/go.mod index bea0ae3e..a9ad1d38 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/prometheus/client_golang v1.0.0 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 github.com/prometheus/common v0.4.1 - github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1 + github.com/prometheus/procfs v0.0.4 github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 github.com/sirupsen/logrus v1.4.2 // indirect github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a diff --git a/go.sum b/go.sum index 3189742e..9a5f7622 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1 h1:uqK/YnaVFq1uofHlzj+IR4HhCYA/nbrvJ431l7cm7Vs= -github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.4 h1:w8DjqFMJDjuVwdZBQoOozr4MVWOnwF7RcL/7uxBjY78= +github.com/prometheus/procfs v0.0.4/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA= github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar index 75dd29d2..8591c276 100644 --- a/vendor/github.com/prometheus/procfs/fixtures.ttar +++ b/vendor/github.com/prometheus/procfs/fixtures.ttar @@ -333,6 +333,981 @@ Node 0, zone DMA32 759 572 791 475 194 45 12 0 Node 0, zone Normal 4381 1093 185 1530 567 102 4 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/crypto +Lines: 971 +name : ccm(aes) +driver : ccm_base(ctr(aes-aesni),cbcmac(aes-aesni)) +module : ccm +priority : 300 +refcnt : 4 +selftest : passed +internal : no +type : aead +async : no +blocksize : 1 +ivsize : 16 +maxauthsize : 16 +geniv : + +name : cbcmac(aes) +driver : cbcmac(aes-aesni) +module : ccm +priority : 300 +refcnt : 7 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 16 + +name : ecdh +driver : ecdh-generic +module : ecdh_generic +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : kpp + +name : ecb(arc4) +driver : ecb(arc4)-generic +module : arc4 +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : no +blocksize : 1 +min keysize : 1 +max keysize : 256 +ivsize : 0 +chunksize : 1 +walksize : 1 + +name : arc4 +driver : arc4-generic +module : arc4 +priority : 0 +refcnt : 3 +selftest : passed +internal : no +type : cipher +blocksize : 1 +min keysize : 1 +max keysize : 256 + +name : crct10dif +driver : crct10dif-pclmul +module : crct10dif_pclmul +priority : 200 +refcnt : 2 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 2 + +name : crc32 +driver : crc32-pclmul +module : crc32_pclmul +priority : 200 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 4 + +name : __ghash +driver : cryptd(__ghash-pclmulqdqni) +module : kernel +priority : 50 +refcnt : 1 +selftest : passed +internal : yes +type : ahash +async : yes +blocksize : 16 +digestsize : 16 + +name : ghash +driver : ghash-clmulni +module : ghash_clmulni_intel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : ahash +async : yes +blocksize : 16 +digestsize : 16 + +name : __ghash +driver : __ghash-pclmulqdqni +module : ghash_clmulni_intel +priority : 0 +refcnt : 1 +selftest : passed +internal : yes +type : shash +blocksize : 16 +digestsize : 16 + +name : crc32c +driver : crc32c-intel +module : crc32c_intel +priority : 200 +refcnt : 5 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 4 + +name : cbc(aes) +driver : cbc(aes-aesni) +module : kernel +priority : 300 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : no +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : ctr(aes) +driver : ctr(aes-aesni) +module : kernel +priority : 300 +refcnt : 5 +selftest : passed +internal : no +type : skcipher +async : no +blocksize : 1 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : pkcs1pad(rsa,sha256) +driver : pkcs1pad(rsa-generic,sha256) +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : akcipher + +name : __xts(aes) +driver : cryptd(__xts-aes-aesni) +module : kernel +priority : 451 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : yes +blocksize : 16 +min keysize : 32 +max keysize : 64 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : xts(aes) +driver : xts-aes-aesni +module : kernel +priority : 401 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : yes +blocksize : 16 +min keysize : 32 +max keysize : 64 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __ctr(aes) +driver : cryptd(__ctr-aes-aesni) +module : kernel +priority : 450 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : yes +blocksize : 1 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : ctr(aes) +driver : ctr-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : yes +blocksize : 1 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __cbc(aes) +driver : cryptd(__cbc-aes-aesni) +module : kernel +priority : 450 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : cbc(aes) +driver : cbc-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __ecb(aes) +driver : cryptd(__ecb-aes-aesni) +module : kernel +priority : 450 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 0 +chunksize : 16 +walksize : 16 + +name : ecb(aes) +driver : ecb-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 0 +chunksize : 16 +walksize : 16 + +name : __generic-gcm-aes-aesni +driver : cryptd(__driver-generic-gcm-aes-aesni) +module : kernel +priority : 50 +refcnt : 1 +selftest : passed +internal : yes +type : aead +async : yes +blocksize : 1 +ivsize : 12 +maxauthsize : 16 +geniv : + +name : gcm(aes) +driver : generic-gcm-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : aead +async : yes +blocksize : 1 +ivsize : 12 +maxauthsize : 16 +geniv : + +name : __generic-gcm-aes-aesni +driver : __driver-generic-gcm-aes-aesni +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : yes +type : aead +async : no +blocksize : 1 +ivsize : 12 +maxauthsize : 16 +geniv : + +name : __gcm-aes-aesni +driver : cryptd(__driver-gcm-aes-aesni) +module : kernel +priority : 50 +refcnt : 1 +selftest : passed +internal : yes +type : aead +async : yes +blocksize : 1 +ivsize : 8 +maxauthsize : 16 +geniv : + +name : rfc4106(gcm(aes)) +driver : rfc4106-gcm-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : no +type : aead +async : yes +blocksize : 1 +ivsize : 8 +maxauthsize : 16 +geniv : + +name : __gcm-aes-aesni +driver : __driver-gcm-aes-aesni +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : yes +type : aead +async : no +blocksize : 1 +ivsize : 8 +maxauthsize : 16 +geniv : + +name : __xts(aes) +driver : __xts-aes-aesni +module : kernel +priority : 401 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : no +blocksize : 16 +min keysize : 32 +max keysize : 64 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __ctr(aes) +driver : __ctr-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : no +blocksize : 1 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __cbc(aes) +driver : __cbc-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : no +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +chunksize : 16 +walksize : 16 + +name : __ecb(aes) +driver : __ecb-aes-aesni +module : kernel +priority : 400 +refcnt : 1 +selftest : passed +internal : yes +type : skcipher +async : no +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 0 +chunksize : 16 +walksize : 16 + +name : __aes +driver : __aes-aesni +module : kernel +priority : 300 +refcnt : 1 +selftest : passed +internal : yes +type : cipher +blocksize : 16 +min keysize : 16 +max keysize : 32 + +name : aes +driver : aes-aesni +module : kernel +priority : 300 +refcnt : 8 +selftest : passed +internal : no +type : cipher +blocksize : 16 +min keysize : 16 +max keysize : 32 + +name : hmac(sha1) +driver : hmac(sha1-generic) +module : kernel +priority : 100 +refcnt : 9 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 20 + +name : ghash +driver : ghash-generic +module : kernel +priority : 100 +refcnt : 3 +selftest : passed +internal : no +type : shash +blocksize : 16 +digestsize : 16 + +name : jitterentropy_rng +driver : jitterentropy_rng +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_hmac_sha256 +module : kernel +priority : 221 +refcnt : 2 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_hmac_sha512 +module : kernel +priority : 220 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_hmac_sha384 +module : kernel +priority : 219 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_hmac_sha1 +module : kernel +priority : 218 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_sha256 +module : kernel +priority : 217 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_sha512 +module : kernel +priority : 216 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_sha384 +module : kernel +priority : 215 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_sha1 +module : kernel +priority : 214 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_ctr_aes256 +module : kernel +priority : 213 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_ctr_aes192 +module : kernel +priority : 212 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_nopr_ctr_aes128 +module : kernel +priority : 211 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : hmac(sha256) +driver : hmac(sha256-generic) +module : kernel +priority : 100 +refcnt : 10 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 32 + +name : stdrng +driver : drbg_pr_hmac_sha256 +module : kernel +priority : 210 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_hmac_sha512 +module : kernel +priority : 209 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_hmac_sha384 +module : kernel +priority : 208 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_hmac_sha1 +module : kernel +priority : 207 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_sha256 +module : kernel +priority : 206 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_sha512 +module : kernel +priority : 205 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_sha384 +module : kernel +priority : 204 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_sha1 +module : kernel +priority : 203 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_ctr_aes256 +module : kernel +priority : 202 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_ctr_aes192 +module : kernel +priority : 201 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : stdrng +driver : drbg_pr_ctr_aes128 +module : kernel +priority : 200 +refcnt : 1 +selftest : passed +internal : no +type : rng +seedsize : 0 + +name : 842 +driver : 842-scomp +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : scomp + +name : 842 +driver : 842-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : compression + +name : lzo-rle +driver : lzo-rle-scomp +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : scomp + +name : lzo-rle +driver : lzo-rle-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : compression + +name : lzo +driver : lzo-scomp +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : scomp + +name : lzo +driver : lzo-generic +module : kernel +priority : 0 +refcnt : 9 +selftest : passed +internal : no +type : compression + +name : crct10dif +driver : crct10dif-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 2 + +name : crc32c +driver : crc32c-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 4 + +name : zlib-deflate +driver : zlib-deflate-scomp +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : scomp + +name : deflate +driver : deflate-scomp +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : scomp + +name : deflate +driver : deflate-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : compression + +name : aes +driver : aes-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : cipher +blocksize : 16 +min keysize : 16 +max keysize : 32 + +name : sha224 +driver : sha224-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 28 + +name : sha256 +driver : sha256-generic +module : kernel +priority : 100 +refcnt : 11 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 32 + +name : sha1 +driver : sha1-generic +module : kernel +priority : 100 +refcnt : 11 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 20 + +name : md5 +driver : md5-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 64 +digestsize : 16 + +name : ecb(cipher_null) +driver : ecb-cipher_null +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : skcipher +async : no +blocksize : 1 +min keysize : 0 +max keysize : 0 +ivsize : 0 +chunksize : 1 +walksize : 1 + +name : digest_null +driver : digest_null-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : shash +blocksize : 1 +digestsize : 0 + +name : compress_null +driver : compress_null-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : compression + +name : cipher_null +driver : cipher_null-generic +module : kernel +priority : 0 +refcnt : 1 +selftest : passed +internal : no +type : cipher +blocksize : 1 +min keysize : 0 +max keysize : 0 + +name : rsa +driver : rsa-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : akcipher + +name : dh +driver : dh-generic +module : kernel +priority : 100 +refcnt : 1 +selftest : passed +internal : no +type : kpp + +name : aes +driver : aes-asm +module : kernel +priority : 200 +refcnt : 1 +selftest : passed +internal : no +type : cipher +blocksize : 16 +min keysize : 16 +max keysize : 32 + +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/diskstats Lines: 49 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 @@ -482,6 +1457,12 @@ Mode: 644 Directory: fixtures/proc/net Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/arp +Lines: 2 +IP address HW type Flags HW address Mask Device +192.168.224.1 0x1 0x2 00:50:56:c0:00:08 * ens33 +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/dev Lines: 6 Inter-| Receive | Transmit @@ -554,6 +1535,11 @@ proc4 2 2 10853 proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/softnet_stat +Lines: 1 +00015c73 00020e76 F0000769 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/unix Lines: 6 Num RefCount Protocol Flags Type St Inode Path @@ -1701,6 +2687,42 @@ Mode: 444 Directory: fixtures/sys/class/thermal Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/thermal/cooling_device0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device0/cur_state +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device0/max_state +Lines: 1 +50 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device0/type +Lines: 1 +Processor +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/thermal/cooling_device1 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device1/cur_state +Lines: 1 +-1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device1/max_state +Lines: 1 +27 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/thermal/cooling_device1/type +Lines: 1 +intel_powerclamp +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/class/thermal/thermal_zone0 Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/github.com/prometheus/procfs/sysfs/net_class.go b/vendor/github.com/prometheus/procfs/sysfs/net_class.go index 909f7fb3..d5c0d6a9 100644 --- a/vendor/github.com/prometheus/procfs/sysfs/net_class.go +++ b/vendor/github.com/prometheus/procfs/sysfs/net_class.go @@ -18,11 +18,7 @@ package sysfs import ( "fmt" "io/ioutil" - "os" "path/filepath" - "reflect" - "strconv" - "strings" "github.com/prometheus/procfs/internal/util" ) @@ -33,32 +29,32 @@ const netclassPath = "class/net" // for single interface (iface). type NetClassIface struct { Name string // Interface name - AddrAssignType *int64 `fileName:"addr_assign_type"` // /sys/class/net//addr_assign_type - AddrLen *int64 `fileName:"addr_len"` // /sys/class/net//addr_len - Address string `fileName:"address"` // /sys/class/net//address - Broadcast string `fileName:"broadcast"` // /sys/class/net//broadcast - Carrier *int64 `fileName:"carrier"` // /sys/class/net//carrier - CarrierChanges *int64 `fileName:"carrier_changes"` // /sys/class/net//carrier_changes - CarrierUpCount *int64 `fileName:"carrier_up_count"` // /sys/class/net//carrier_up_count - CarrierDownCount *int64 `fileName:"carrier_down_count"` // /sys/class/net//carrier_down_count - DevID *int64 `fileName:"dev_id"` // /sys/class/net//dev_id - Dormant *int64 `fileName:"dormant"` // /sys/class/net//dormant - Duplex string `fileName:"duplex"` // /sys/class/net//duplex - Flags *int64 `fileName:"flags"` // /sys/class/net//flags - IfAlias string `fileName:"ifalias"` // /sys/class/net//ifalias - IfIndex *int64 `fileName:"ifindex"` // /sys/class/net//ifindex - IfLink *int64 `fileName:"iflink"` // /sys/class/net//iflink - LinkMode *int64 `fileName:"link_mode"` // /sys/class/net//link_mode - MTU *int64 `fileName:"mtu"` // /sys/class/net//mtu - NameAssignType *int64 `fileName:"name_assign_type"` // /sys/class/net//name_assign_type - NetDevGroup *int64 `fileName:"netdev_group"` // /sys/class/net//netdev_group - OperState string `fileName:"operstate"` // /sys/class/net//operstate - PhysPortID string `fileName:"phys_port_id"` // /sys/class/net//phys_port_id - PhysPortName string `fileName:"phys_port_name"` // /sys/class/net//phys_port_name - PhysSwitchID string `fileName:"phys_switch_id"` // /sys/class/net//phys_switch_id - Speed *int64 `fileName:"speed"` // /sys/class/net//speed - TxQueueLen *int64 `fileName:"tx_queue_len"` // /sys/class/net//tx_queue_len - Type *int64 `fileName:"type"` // /sys/class/net//type + AddrAssignType *int64 // /sys/class/net//addr_assign_type + AddrLen *int64 // /sys/class/net//addr_len + Address string // /sys/class/net//address + Broadcast string // /sys/class/net//broadcast + Carrier *int64 // /sys/class/net//carrier + CarrierChanges *int64 // /sys/class/net//carrier_changes + CarrierUpCount *int64 // /sys/class/net//carrier_up_count + CarrierDownCount *int64 // /sys/class/net//carrier_down_count + DevID *int64 // /sys/class/net//dev_id + Dormant *int64 // /sys/class/net//dormant + Duplex string // /sys/class/net//duplex + Flags *int64 // /sys/class/net//flags + IfAlias string // /sys/class/net//ifalias + IfIndex *int64 // /sys/class/net//ifindex + IfLink *int64 // /sys/class/net//iflink + LinkMode *int64 // /sys/class/net//link_mode + MTU *int64 // /sys/class/net//mtu + NameAssignType *int64 // /sys/class/net//name_assign_type + NetDevGroup *int64 // /sys/class/net//netdev_group + OperState string // /sys/class/net//operstate + PhysPortID string // /sys/class/net//phys_port_id + PhysPortName string // /sys/class/net//phys_port_name + PhysSwitchID string // /sys/class/net//phys_switch_id + Speed *int64 // /sys/class/net//speed + TxQueueLen *int64 // /sys/class/net//tx_queue_len + Type *int64 // /sys/class/net//type } // NetClass is collection of info for every interface (iface) in /sys/class/net. The map keys @@ -109,54 +105,77 @@ func (fs FS) NetClass() (NetClass, error) { // directory and gets their contents. func (nc NetClass) parseNetClassIface(devicePath string) (*NetClassIface, error) { interfaceClass := NetClassIface{} - interfaceElem := reflect.ValueOf(&interfaceClass).Elem() - interfaceType := reflect.TypeOf(interfaceClass) - //start from 1 - skip the Name field - for i := 1; i < interfaceElem.NumField(); i++ { - fieldType := interfaceType.Field(i) - fieldValue := interfaceElem.Field(i) - - if fieldType.Tag.Get("fileName") == "" { - panic(fmt.Errorf("field %s does not have a filename tag", fieldType.Name)) - } - - value, err := util.SysReadFile(devicePath + "/" + fieldType.Tag.Get("fileName")) - - if err != nil { - if os.IsNotExist(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { - continue - } - return nil, fmt.Errorf("could not access file %s: %s", fieldType.Tag.Get("fileName"), err) - } - - switch fieldValue.Kind() { - case reflect.String: - fieldValue.SetString(value) - case reflect.Ptr: - var int64ptr *int64 - switch fieldValue.Type() { - case reflect.TypeOf(int64ptr): - var intValue int64 - if strings.HasPrefix(value, "0x") { - intValue, err = strconv.ParseInt(value[2:], 16, 64) - if err != nil { - return nil, fmt.Errorf("expected hex value for %s, got: %s", fieldType.Name, value) - } - } else { - intValue, err = strconv.ParseInt(value, 10, 64) - if err != nil { - return nil, fmt.Errorf("expected Uint64 value for %s, got: %s", fieldType.Name, value) - } - } - fieldValue.Set(reflect.ValueOf(&intValue)) - default: - return nil, fmt.Errorf("unhandled pointer type %q", fieldValue.Type()) - } - default: - return nil, fmt.Errorf("unhandled type %q", fieldValue.Kind()) - } + files, err := ioutil.ReadDir(devicePath) + if err != nil { + return nil, err } + for _, f := range files { + if f.IsDir() { + continue + } + name := filepath.Join(devicePath, f.Name()) + value, err := util.SysReadFile(name) + if err != nil { + return nil, fmt.Errorf("failed to read file %q: %v", name, err) + } + vp := util.NewValueParser(value) + switch f.Name() { + case "addr_assign_type": + interfaceClass.AddrAssignType = vp.PInt64() + case "addr_len": + interfaceClass.AddrLen = vp.PInt64() + case "address": + interfaceClass.Address = value + case "broadcast": + interfaceClass.Broadcast = value + case "carrier": + interfaceClass.Carrier = vp.PInt64() + case "carrier_changes": + interfaceClass.CarrierChanges = vp.PInt64() + case "carrier_up_count": + interfaceClass.CarrierUpCount = vp.PInt64() + case "carrier_down_count": + interfaceClass.CarrierDownCount = vp.PInt64() + case "dev_id": + interfaceClass.DevID = vp.PInt64() + case "dormant": + interfaceClass.Dormant = vp.PInt64() + case "duplex": + interfaceClass.Duplex = value + case "flags": + interfaceClass.Flags = vp.PInt64() + case "ifalias": + interfaceClass.IfAlias = value + case "ifindex": + interfaceClass.IfIndex = vp.PInt64() + case "iflink": + interfaceClass.IfLink = vp.PInt64() + case "link_mode": + interfaceClass.LinkMode = vp.PInt64() + case "mtu": + interfaceClass.MTU = vp.PInt64() + case "name_assign_type": + interfaceClass.NameAssignType = vp.PInt64() + case "netdev_group": + interfaceClass.NetDevGroup = vp.PInt64() + case "operstate": + interfaceClass.OperState = value + case "phys_port_id": + interfaceClass.PhysPortID = value + case "phys_port_name": + interfaceClass.PhysPortName = value + case "phys_switch_id": + interfaceClass.PhysSwitchID = value + case "speed": + interfaceClass.Speed = vp.PInt64() + case "tx_queue_len": + interfaceClass.TxQueueLen = vp.PInt64() + case "type": + interfaceClass.Type = vp.PInt64() + } + } return &interfaceClass, nil + } diff --git a/vendor/github.com/prometheus/procfs/vm.go b/vendor/github.com/prometheus/procfs/vm.go index f22651c2..cb138914 100644 --- a/vendor/github.com/prometheus/procfs/vm.go +++ b/vendor/github.com/prometheus/procfs/vm.go @@ -31,49 +31,49 @@ import ( // Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array // and numa_zonelist_order (deprecated) which is a string type VM struct { - AdminReserveKbytes int64 // /proc/sys/vm/admin_reserve_kbytes - BlockDump int64 // /proc/sys/vm/block_dump - CompactUnevictableAllowed int64 // /proc/sys/vm/compact_unevictable_allowed - DirtyBackgroundBytes int64 // /proc/sys/vm/dirty_background_bytes - DirtyBackgroundRatio int64 // /proc/sys/vm/dirty_background_ratio - DirtyBytes int64 // /proc/sys/vm/dirty_bytes - DirtyExpireCentisecs int64 // /proc/sys/vm/dirty_expire_centisecs - DirtyRatio int64 // /proc/sys/vm/dirty_ratio - DirtytimeExpireSeconds int64 // /proc/sys/vm/dirtytime_expire_seconds - DirtyWritebackCentisecs int64 // /proc/sys/vm/dirty_writeback_centisecs - DropCaches int64 // /proc/sys/vm/drop_caches - ExtfragThreshold int64 // /proc/sys/vm/extfrag_threshold - HugetlbShmGroup int64 // /proc/sys/vm/hugetlb_shm_group - LaptopMode int64 // /proc/sys/vm/laptop_mode - LegacyVaLayout int64 // /proc/sys/vm/legacy_va_layout - LowmemReserveRatio []int64 // /proc/sys/vm/lowmem_reserve_ratio - MaxMapCount int64 // /proc/sys/vm/max_map_count - MemoryFailureEarlyKill int64 // /proc/sys/vm/memory_failure_early_kill - MemoryFailureRecovery int64 // /proc/sys/vm/memory_failure_recovery - MinFreeKbytes int64 // /proc/sys/vm/min_free_kbytes - MinSlabRatio int64 // /proc/sys/vm/min_slab_ratio - MinUnmappedRatio int64 // /proc/sys/vm/min_unmapped_ratio - MmapMinAddr int64 // /proc/sys/vm/mmap_min_addr - NrHugepages int64 // /proc/sys/vm/nr_hugepages - NrHugepagesMempolicy int64 // /proc/sys/vm/nr_hugepages_mempolicy - NrOvercommitHugepages int64 // /proc/sys/vm/nr_overcommit_hugepages - NumaStat int64 // /proc/sys/vm/numa_stat - NumaZonelistOrder string // /proc/sys/vm/numa_zonelist_order - OomDumpTasks int64 // /proc/sys/vm/oom_dump_tasks - OomKillAllocatingTask int64 // /proc/sys/vm/oom_kill_allocating_task - OvercommitKbytes int64 // /proc/sys/vm/overcommit_kbytes - OvercommitMemory int64 // /proc/sys/vm/overcommit_memory - OvercommitRatio int64 // /proc/sys/vm/overcommit_ratio - PageCluster int64 // /proc/sys/vm/page-cluster - PanicOnOom int64 // /proc/sys/vm/panic_on_oom - PercpuPagelistFraction int64 // /proc/sys/vm/percpu_pagelist_fraction - StatInterval int64 // /proc/sys/vm/stat_interval - Swappiness int64 // /proc/sys/vm/swappiness - UserReserveKbytes int64 // /proc/sys/vm/user_reserve_kbytes - VfsCachePressure int64 // /proc/sys/vm/vfs_cache_pressure - WatermarkBoostFactor int64 // /proc/sys/vm/watermark_boost_factor - WatermarkScaleFactor int64 // /proc/sys/vm/watermark_scale_factor - ZoneReclaimMode int64 // /proc/sys/vm/zone_reclaim_mode + AdminReserveKbytes *int64 // /proc/sys/vm/admin_reserve_kbytes + BlockDump *int64 // /proc/sys/vm/block_dump + CompactUnevictableAllowed *int64 // /proc/sys/vm/compact_unevictable_allowed + DirtyBackgroundBytes *int64 // /proc/sys/vm/dirty_background_bytes + DirtyBackgroundRatio *int64 // /proc/sys/vm/dirty_background_ratio + DirtyBytes *int64 // /proc/sys/vm/dirty_bytes + DirtyExpireCentisecs *int64 // /proc/sys/vm/dirty_expire_centisecs + DirtyRatio *int64 // /proc/sys/vm/dirty_ratio + DirtytimeExpireSeconds *int64 // /proc/sys/vm/dirtytime_expire_seconds + DirtyWritebackCentisecs *int64 // /proc/sys/vm/dirty_writeback_centisecs + DropCaches *int64 // /proc/sys/vm/drop_caches + ExtfragThreshold *int64 // /proc/sys/vm/extfrag_threshold + HugetlbShmGroup *int64 // /proc/sys/vm/hugetlb_shm_group + LaptopMode *int64 // /proc/sys/vm/laptop_mode + LegacyVaLayout *int64 // /proc/sys/vm/legacy_va_layout + LowmemReserveRatio []*int64 // /proc/sys/vm/lowmem_reserve_ratio + MaxMapCount *int64 // /proc/sys/vm/max_map_count + MemoryFailureEarlyKill *int64 // /proc/sys/vm/memory_failure_early_kill + MemoryFailureRecovery *int64 // /proc/sys/vm/memory_failure_recovery + MinFreeKbytes *int64 // /proc/sys/vm/min_free_kbytes + MinSlabRatio *int64 // /proc/sys/vm/min_slab_ratio + MinUnmappedRatio *int64 // /proc/sys/vm/min_unmapped_ratio + MmapMinAddr *int64 // /proc/sys/vm/mmap_min_addr + NrHugepages *int64 // /proc/sys/vm/nr_hugepages + NrHugepagesMempolicy *int64 // /proc/sys/vm/nr_hugepages_mempolicy + NrOvercommitHugepages *int64 // /proc/sys/vm/nr_overcommit_hugepages + NumaStat *int64 // /proc/sys/vm/numa_stat + NumaZonelistOrder string // /proc/sys/vm/numa_zonelist_order + OomDumpTasks *int64 // /proc/sys/vm/oom_dump_tasks + OomKillAllocatingTask *int64 // /proc/sys/vm/oom_kill_allocating_task + OvercommitKbytes *int64 // /proc/sys/vm/overcommit_kbytes + OvercommitMemory *int64 // /proc/sys/vm/overcommit_memory + OvercommitRatio *int64 // /proc/sys/vm/overcommit_ratio + PageCluster *int64 // /proc/sys/vm/page-cluster + PanicOnOom *int64 // /proc/sys/vm/panic_on_oom + PercpuPagelistFraction *int64 // /proc/sys/vm/percpu_pagelist_fraction + StatInterval *int64 // /proc/sys/vm/stat_interval + Swappiness *int64 // /proc/sys/vm/swappiness + UserReserveKbytes *int64 // /proc/sys/vm/user_reserve_kbytes + VfsCachePressure *int64 // /proc/sys/vm/vfs_cache_pressure + WatermarkBoostFactor *int64 // /proc/sys/vm/watermark_boost_factor + WatermarkScaleFactor *int64 // /proc/sys/vm/watermark_scale_factor + ZoneReclaimMode *int64 // /proc/sys/vm/zone_reclaim_mode } // VM reads the VM statistics from the specified `proc` filesystem. @@ -109,97 +109,97 @@ func (fs FS) VM() (*VM, error) { switch f.Name() { case "admin_reserve_kbytes": - vm.AdminReserveKbytes = *vp.PInt64() + vm.AdminReserveKbytes = vp.PInt64() case "block_dump": - vm.BlockDump = *vp.PInt64() + vm.BlockDump = vp.PInt64() case "compact_unevictable_allowed": - vm.CompactUnevictableAllowed = *vp.PInt64() + vm.CompactUnevictableAllowed = vp.PInt64() case "dirty_background_bytes": - vm.DirtyBackgroundBytes = *vp.PInt64() + vm.DirtyBackgroundBytes = vp.PInt64() case "dirty_background_ratio": - vm.DirtyBackgroundRatio = *vp.PInt64() + vm.DirtyBackgroundRatio = vp.PInt64() case "dirty_bytes": - vm.DirtyBytes = *vp.PInt64() + vm.DirtyBytes = vp.PInt64() case "dirty_expire_centisecs": - vm.DirtyExpireCentisecs = *vp.PInt64() + vm.DirtyExpireCentisecs = vp.PInt64() case "dirty_ratio": - vm.DirtyRatio = *vp.PInt64() + vm.DirtyRatio = vp.PInt64() case "dirtytime_expire_seconds": - vm.DirtytimeExpireSeconds = *vp.PInt64() + vm.DirtytimeExpireSeconds = vp.PInt64() case "dirty_writeback_centisecs": - vm.DirtyWritebackCentisecs = *vp.PInt64() + vm.DirtyWritebackCentisecs = vp.PInt64() case "drop_caches": - vm.DropCaches = *vp.PInt64() + vm.DropCaches = vp.PInt64() case "extfrag_threshold": - vm.ExtfragThreshold = *vp.PInt64() + vm.ExtfragThreshold = vp.PInt64() case "hugetlb_shm_group": - vm.HugetlbShmGroup = *vp.PInt64() + vm.HugetlbShmGroup = vp.PInt64() case "laptop_mode": - vm.LaptopMode = *vp.PInt64() + vm.LaptopMode = vp.PInt64() case "legacy_va_layout": - vm.LegacyVaLayout = *vp.PInt64() + vm.LegacyVaLayout = vp.PInt64() case "lowmem_reserve_ratio": stringSlice := strings.Fields(value) - int64Slice := make([]int64, 0, len(stringSlice)) + pint64Slice := make([]*int64, 0, len(stringSlice)) for _, value := range stringSlice { vp := util.NewValueParser(value) - int64Slice = append(int64Slice, *vp.PInt64()) + pint64Slice = append(pint64Slice, vp.PInt64()) } - vm.LowmemReserveRatio = int64Slice + vm.LowmemReserveRatio = pint64Slice case "max_map_count": - vm.MaxMapCount = *vp.PInt64() + vm.MaxMapCount = vp.PInt64() case "memory_failure_early_kill": - vm.MemoryFailureEarlyKill = *vp.PInt64() + vm.MemoryFailureEarlyKill = vp.PInt64() case "memory_failure_recovery": - vm.MemoryFailureRecovery = *vp.PInt64() + vm.MemoryFailureRecovery = vp.PInt64() case "min_free_kbytes": - vm.MinFreeKbytes = *vp.PInt64() + vm.MinFreeKbytes = vp.PInt64() case "min_slab_ratio": - vm.MinSlabRatio = *vp.PInt64() + vm.MinSlabRatio = vp.PInt64() case "min_unmapped_ratio": - vm.MinUnmappedRatio = *vp.PInt64() + vm.MinUnmappedRatio = vp.PInt64() case "mmap_min_addr": - vm.MmapMinAddr = *vp.PInt64() + vm.MmapMinAddr = vp.PInt64() case "nr_hugepages": - vm.NrHugepages = *vp.PInt64() + vm.NrHugepages = vp.PInt64() case "nr_hugepages_mempolicy": - vm.NrHugepagesMempolicy = *vp.PInt64() + vm.NrHugepagesMempolicy = vp.PInt64() case "nr_overcommit_hugepages": - vm.NrOvercommitHugepages = *vp.PInt64() + vm.NrOvercommitHugepages = vp.PInt64() case "numa_stat": - vm.NumaStat = *vp.PInt64() + vm.NumaStat = vp.PInt64() case "numa_zonelist_order": vm.NumaZonelistOrder = value case "oom_dump_tasks": - vm.OomDumpTasks = *vp.PInt64() + vm.OomDumpTasks = vp.PInt64() case "oom_kill_allocating_task": - vm.OomKillAllocatingTask = *vp.PInt64() + vm.OomKillAllocatingTask = vp.PInt64() case "overcommit_kbytes": - vm.OvercommitKbytes = *vp.PInt64() + vm.OvercommitKbytes = vp.PInt64() case "overcommit_memory": - vm.OvercommitMemory = *vp.PInt64() + vm.OvercommitMemory = vp.PInt64() case "overcommit_ratio": - vm.OvercommitRatio = *vp.PInt64() + vm.OvercommitRatio = vp.PInt64() case "page-cluster": - vm.PageCluster = *vp.PInt64() + vm.PageCluster = vp.PInt64() case "panic_on_oom": - vm.PanicOnOom = *vp.PInt64() + vm.PanicOnOom = vp.PInt64() case "percpu_pagelist_fraction": - vm.PercpuPagelistFraction = *vp.PInt64() + vm.PercpuPagelistFraction = vp.PInt64() case "stat_interval": - vm.StatInterval = *vp.PInt64() + vm.StatInterval = vp.PInt64() case "swappiness": - vm.Swappiness = *vp.PInt64() + vm.Swappiness = vp.PInt64() case "user_reserve_kbytes": - vm.UserReserveKbytes = *vp.PInt64() + vm.UserReserveKbytes = vp.PInt64() case "vfs_cache_pressure": - vm.VfsCachePressure = *vp.PInt64() + vm.VfsCachePressure = vp.PInt64() case "watermark_boost_factor": - vm.WatermarkBoostFactor = *vp.PInt64() + vm.WatermarkBoostFactor = vp.PInt64() case "watermark_scale_factor": - vm.WatermarkScaleFactor = *vp.PInt64() + vm.WatermarkScaleFactor = vp.PInt64() case "zone_reclaim_mode": - vm.ZoneReclaimMode = *vp.PInt64() + vm.ZoneReclaimMode = vp.PInt64() } if err := vp.Err(); err != nil { return nil, err diff --git a/vendor/github.com/prometheus/procfs/xfs/parse.go b/vendor/github.com/prometheus/procfs/xfs/parse.go index b3d8634d..97814464 100644 --- a/vendor/github.com/prometheus/procfs/xfs/parse.go +++ b/vendor/github.com/prometheus/procfs/xfs/parse.go @@ -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 +} diff --git a/vendor/github.com/prometheus/procfs/xfs/xfs.go b/vendor/github.com/prometheus/procfs/xfs/xfs.go index 3aad6617..018a0b89 100644 --- a/vendor/github.com/prometheus/procfs/xfs/xfs.go +++ b/vendor/github.com/prometheus/procfs/xfs/xfs.go @@ -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 { diff --git a/vendor/modules.txt b/vendor/modules.txt index b800abcc..a74d6d78 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -45,7 +45,7 @@ github.com/prometheus/common/version github.com/prometheus/common/expfmt github.com/prometheus/common/model github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg -# github.com/prometheus/procfs v0.0.4-0.20190731153504-5da962fa40f1 +# github.com/prometheus/procfs v0.0.4 github.com/prometheus/procfs github.com/prometheus/procfs/bcache github.com/prometheus/procfs/nfs