123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package gupta
- import (
- "fmt"
- )
- const version = "0.0.1"
- func Hello() string {
- return fmt.Sprintf("Welcome to gupta version %s", version)
- }
- func Run(load, cpu, memory bool, partition, networkInterface string) (cpuLoad, cpuUsage, memoryUsage float64) {
- cpuLoad = 0.2
- cpuUsage = 0.2
- memoryUsage = 70.0
- return cpuLoad, cpuUsage, memoryUsage
- }
- type GuptaReport struct {
- cpuLoad float64
- cpuUsage float64
- memoryUsage float64
- }
- func (g *GuptaReport) GetCPULoad() string {
- return fmt.Sprintf("%.2f", g.cpuLoad)
- }
- type CPULoad struct {
- user int
- nice int
- system int
- idle int
- iowait int
- irq int
- softirq int
- steal int
- guest int
- guest_nice int
- }
- func (c *CPULoad) ReadInfo(rawInfo []string) {
- c.user = 1
- }
|