...

Source file src/github.com/shirou/gopsutil/load/load.go

Documentation: github.com/shirou/gopsutil/load

     1  package load
     2  
     3  import (
     4  	"encoding/json"
     5  
     6  	"github.com/shirou/gopsutil/internal/common"
     7  )
     8  
     9  var invoke common.Invoker = common.Invoke{}
    10  
    11  type AvgStat struct {
    12  	Load1  float64 `json:"load1"`
    13  	Load5  float64 `json:"load5"`
    14  	Load15 float64 `json:"load15"`
    15  }
    16  
    17  func (l AvgStat) String() string {
    18  	s, _ := json.Marshal(l)
    19  	return string(s)
    20  }
    21  
    22  type MiscStat struct {
    23  	ProcsTotal   int `json:"procsTotal"`
    24  	ProcsCreated int `json:"procsCreated"`
    25  	ProcsRunning int `json:"procsRunning"`
    26  	ProcsBlocked int `json:"procsBlocked"`
    27  	Ctxt         int `json:"ctxt"`
    28  }
    29  
    30  func (m MiscStat) String() string {
    31  	s, _ := json.Marshal(m)
    32  	return string(s)
    33  }
    34  

View as plain text