fixed imports and spelling error

pull/205/head
Ben Aldrich 9 years ago
parent c36f7ac8b0
commit a76195e088

@ -2,11 +2,12 @@ package cpu
import (
"encoding/json"
"github.com/shirou/gopsutil/internal/common"
"runtime"
"strconv"
"strings"
"sync"
"github.com/shirou/gopsutil/internal/common"
)
type TimesStat struct {

@ -26,7 +26,7 @@ func calculateBusy(t1, t2 TimesStat) float64 {
return (t2Busy - t1Busy) / (t2All - t1All) * 100
}
func calcualteALLBusy(t1, t2 []TimesStat) ([]float64, error) {
func calculateALLBusy(t1, t2 []TimesStat) ([]float64, error) {
// Make sure the CPU measurements have the same length.
if len(t1) != len(t2) {
return nil, fmt.Errorf(
@ -63,7 +63,7 @@ func Percent(interval time.Duration, percpu bool) ([]float64, error) {
return nil, err
}
return calcualteALLBusy(cpuTimes1, cpuTimes2)
return calculateALLBusy(cpuTimes1, cpuTimes2)
}
func percentUsedFromLastCall(percpu bool) ([]float64, error) {
@ -85,6 +85,6 @@ func percentUsedFromLastCall(percpu bool) ([]float64, error) {
if lastTimes == nil {
return nil, fmt.Errorf("Error getting times for cpu percent. LastTimes was nil")
}
return calcualteALLBusy(lastTimes, cpuTimes)
return calculateALLBusy(lastTimes, cpuTimes)
}

Loading…
Cancel
Save