@@ -91,7 +91,7 @@ func (c TimesStat) String() string {
9191
9292// Deprecated: Total returns the total number of seconds in a CPUTimesStat
9393// Please do not use this internal function.
94- func (c TimesStat ) Total () float64 {
94+ func (c * TimesStat ) Total () float64 {
9595 total := c .User + c .System + c .Idle + c .Nice + c .Iowait + c .Irq +
9696 c .Softirq + c .Steal + c .Guest + c .GuestNice
9797
@@ -103,7 +103,7 @@ func (c InfoStat) String() string {
103103 return string (s )
104104}
105105
106- func getAllBusy (t TimesStat ) (float64 , float64 ) {
106+ func getAllBusy (t * TimesStat ) (float64 , float64 ) {
107107 tot := t .Total ()
108108 if runtime .GOOS == "linux" {
109109 tot -= t .Guest // Linux 2.6.24+
@@ -115,7 +115,7 @@ func getAllBusy(t TimesStat) (float64, float64) {
115115 return tot , busy
116116}
117117
118- func calculateBusy (t1 , t2 TimesStat ) float64 {
118+ func calculateBusy (t1 , t2 * TimesStat ) float64 {
119119 t1All , t1Busy := getAllBusy (t1 )
120120 t2All , t2Busy := getAllBusy (t2 )
121121
@@ -139,7 +139,7 @@ func calculateAllBusy(t1, t2 []TimesStat) ([]float64, error) {
139139
140140 ret := make ([]float64 , len (t1 ))
141141 for i , t := range t2 {
142- ret [i ] = calculateBusy (t1 [i ], t )
142+ ret [i ] = calculateBusy (& t1 [i ], & t )
143143 }
144144 return ret , nil
145145}
0 commit comments