本文整理匯總了Golang中github.com/elastic/gosigar.ConcreteSigar.GetSwap方法的典型用法代碼示例。如果您正苦於以下問題:Golang ConcreteSigar.GetSwap方法的具體用法?Golang ConcreteSigar.GetSwap怎麽用?Golang ConcreteSigar.GetSwap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/elastic/gosigar.ConcreteSigar
的用法示例。
在下文中一共展示了ConcreteSigar.GetSwap方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
Expect(avg.Five).ToNot(BeNil())
Expect(avg.Fifteen).ToNot(BeNil())
Expect(err).ToNot(HaveOccurred())
})
It("GetMem", func() {
mem, err := concreteSigar.GetMem()
Expect(err).ToNot(HaveOccurred())
Expect(mem.Total).To(BeNumerically(">", 0))
Expect(mem.Used + mem.Free).To(BeNumerically("<=", mem.Total))
})
It("GetSwap", func() {
swap, err := concreteSigar.GetSwap()
Expect(err).ToNot(HaveOccurred())
Expect(swap.Used + swap.Free).To(BeNumerically("<=", swap.Total))
})
It("GetSwap", func() {
fsusage, err := concreteSigar.GetFileSystemUsage("/")
Expect(err).ToNot(HaveOccurred())
Expect(fsusage.Total).ToNot(BeNil())
fsusage, err = concreteSigar.GetFileSystemUsage("T O T A L L Y B O G U S")
Expect(err).To(HaveOccurred())
Expect(fsusage.Total).To(Equal(uint64(0)))
})
})