1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-28 13:48:49 +08:00

revert imports

This commit is contained in:
marcospedreiro 2018-11-19 22:06:05 -08:00
parent 3cc34ebf18
commit d47801b68b
61 changed files with 87 additions and 87 deletions

View File

@ -61,7 +61,7 @@ Note: gopsutil v2 breaks compatibility. If you want to stay with compatibility,
import ( import (
"fmt" "fmt"
"github.com/marcospedreiro/gopsutil/mem" "github.com/shirou/gopsutil/mem"
) )
func main() { func main() {

View File

@ -10,7 +10,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// TimesStat contains the amounts of time the CPU has spent performing different // TimesStat contains the amounts of time the CPU has spent performing different

View File

@ -3,7 +3,7 @@
package cpu package cpu
import "github.com/marcospedreiro/gopsutil/internal/common" import "github.com/shirou/gopsutil/internal/common"
func perCPUTimes() ([]TimesStat, error) { func perCPUTimes() ([]TimesStat, error) {
return []TimesStat{}, common.ErrNotImplementedError return []TimesStat{}, common.ErrNotImplementedError

View File

@ -5,7 +5,7 @@ package cpu
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Times(percpu bool) ([]TimesStat, error) { func Times(percpu bool) ([]TimesStat, error) {

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -5,7 +5,7 @@ import (
"runtime" "runtime"
"testing" "testing"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func TestParseDmesgBoot(t *testing.T) { func TestParseDmesgBoot(t *testing.T) {

View File

@ -10,7 +10,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var CPUTick = float64(100) var CPUTick = float64(100)

View File

@ -11,7 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -10,7 +10,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var ClocksPerSec = float64(128) var ClocksPerSec = float64(128)

View File

@ -8,7 +8,7 @@ import (
"unsafe" "unsafe"
"github.com/StackExchange/wmi" "github.com/StackExchange/wmi"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

View File

@ -3,7 +3,7 @@ package disk
import ( import (
"encoding/json" "encoding/json"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

View File

@ -7,7 +7,7 @@ import (
"path" "path"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -31,7 +31,7 @@ import (
"strings" "strings"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func IOCounters(names ...string) (map[string]IOCountersStat, error) { func IOCounters(names ...string) (map[string]IOCountersStat, error) {

View File

@ -6,7 +6,7 @@ package disk
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func IOCounters(names ...string) (map[string]IOCountersStat, error) { func IOCounters(names ...string) (map[string]IOCountersStat, error) {

View File

@ -5,7 +5,7 @@ package disk
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func IOCounters(names ...string) (map[string]IOCountersStat, error) { func IOCounters(names ...string) (map[string]IOCountersStat, error) {

View File

@ -12,7 +12,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Partitions(all bool) ([]PartitionStat, error) { func Partitions(all bool) ([]PartitionStat, error) {

View File

@ -14,7 +14,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
const ( const (

View File

@ -9,7 +9,7 @@ import (
"path" "path"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -10,7 +10,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -51,7 +51,7 @@ func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
ret.UsedPercent = 0 ret.UsedPercent = 0
} else { } else {
// We don't use ret.Total to calculate percent. // We don't use ret.Total to calculate percent.
// see https://github.com/marcospedreiro/gopsutil/issues/562 // see https://github.com/shirou/gopsutil/issues/562
ret.UsedPercent = (float64(ret.Used) / float64(ret.Used+ret.Free)) * 100.0 ret.UsedPercent = (float64(ret.Used) / float64(ret.Used+ret.Free)) * 100.0
} }

View File

@ -7,7 +7,7 @@ import (
"context" "context"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

View File

@ -4,8 +4,8 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/marcospedreiro/gopsutil/cpu" "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var ErrDockerNotAvailable = errors.New("docker not available") var ErrDockerNotAvailable = errors.New("docker not available")

View File

@ -11,8 +11,8 @@ import (
"strconv" "strconv"
"strings" "strings"
cpu "github.com/marcospedreiro/gopsutil/cpu" cpu "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// GetDockerStat returns a list of Docker basic stats. // GetDockerStat returns a list of Docker basic stats.

View File

@ -5,8 +5,8 @@ package docker
import ( import (
"context" "context"
cpu "github.com/marcospedreiro/gopsutil/cpu" cpu "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// GetDockerStat returns a list of Docker basic stats. // GetDockerStat returns a list of Docker basic stats.

View File

@ -3,7 +3,7 @@ package host
import ( import (
"encoding/json" "encoding/json"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

View File

@ -16,8 +16,8 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/process" "github.com/shirou/gopsutil/process"
) )
// from utmpx.h // from utmpx.h

View File

@ -5,7 +5,7 @@ package host
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Info() (*InfoStat, error) { func Info() (*InfoStat, error) {

View File

@ -15,8 +15,8 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/process" "github.com/shirou/gopsutil/process"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -18,7 +18,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
type LSB struct { type LSB struct {

View File

@ -15,8 +15,8 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/process" "github.com/shirou/gopsutil/process"
) )
const ( const (

View File

@ -14,7 +14,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Info() (*InfoStat, error) { func Info() (*InfoStat, error) {

View File

@ -15,8 +15,8 @@ import (
"unsafe" "unsafe"
"github.com/StackExchange/wmi" "github.com/StackExchange/wmi"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
process "github.com/marcospedreiro/gopsutil/process" process "github.com/shirou/gopsutil/process"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )
@ -102,7 +102,7 @@ func InfoWithContext(ctx context.Context) (*InfoStat, error) {
} }
func getMachineGuid() (string, error) { func getMachineGuid() (string, error) {
// there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/marcospedreiro/gopsutil/pull/312#issuecomment-277422612 // there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/shirou/gopsutil/pull/312#issuecomment-277422612
// for rationale of using windows.RegOpenKeyEx/RegQueryValueEx instead of registry.OpenKey/GetStringValue // for rationale of using windows.RegOpenKeyEx/RegQueryValueEx instead of registry.OpenKey/GetStringValue
var h windows.Handle var h windows.Handle
err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Cryptography`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h) err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE, windows.StringToUTF16Ptr(`SOFTWARE\Microsoft\Cryptography`), 0, windows.KEY_READ|windows.KEY_WOW64_64KEY, &h)

View File

@ -3,7 +3,7 @@ package load
import ( import (
"encoding/json" "encoding/json"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Avg() (*AvgStat, error) { func Avg() (*AvgStat, error) {

View File

@ -5,7 +5,7 @@ package load
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Avg() (*AvgStat, error) { func Avg() (*AvgStat, error) {

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Avg() (*AvgStat, error) { func Avg() (*AvgStat, error) {

View File

@ -5,7 +5,7 @@ package load
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func Avg() (*AvgStat, error) { func Avg() (*AvgStat, error) {

View File

@ -3,7 +3,7 @@ package mem
import ( import (
"encoding/json" "encoding/json"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

View File

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -5,7 +5,7 @@ package mem
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func VirtualMemory() (*VirtualMemoryStat, error) { func VirtualMemory() (*VirtualMemoryStat, error) {

View File

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -10,7 +10,7 @@ import (
"fmt" "fmt"
"os/exec" "os/exec"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func GetPageSize() (uint64, error) { func GetPageSize() (uint64, error) {

View File

@ -9,7 +9,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// VirtualMemory for Solaris is a minimal implementation which only returns // VirtualMemory for Solaris is a minimal implementation which only returns

View File

@ -6,7 +6,7 @@ import (
"context" "context"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

View File

@ -5,7 +5,7 @@ package net
import ( import (
"context" "context"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func IOCounters(pernic bool) ([]IOCountersStat, error) { func IOCounters(pernic bool) ([]IOCountersStat, error) {

View File

@ -9,7 +9,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func IOCounters(pernic bool) ([]IOCountersStat, error) { func IOCounters(pernic bool) ([]IOCountersStat, error) {

View File

@ -15,7 +15,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// NetIOCounters returnes network I/O statistics for every network // NetIOCounters returnes network I/O statistics for every network
@ -661,7 +661,7 @@ func processInet(file string, kind netConnectionKindType, inodes map[string][]in
// Read the contents of the /proc file with a single read sys call. // Read the contents of the /proc file with a single read sys call.
// This minimizes duplicates in the returned connections // This minimizes duplicates in the returned connections
// For more info: // For more info:
// https://github.com/marcospedreiro/gopsutil/pull/361 // https://github.com/shirou/gopsutil/pull/361
contents, err := ioutil.ReadFile(file) contents, err := ioutil.ReadFile(file)
if err != nil { if err != nil {
return nil, err return nil, err
@ -722,7 +722,7 @@ func processUnix(file string, kind netConnectionKindType, inodes map[string][]in
// Read the contents of the /proc file with a single read sys call. // Read the contents of the /proc file with a single read sys call.
// This minimizes duplicates in the returned connections // This minimizes duplicates in the returned connections
// For more info: // For more info:
// https://github.com/marcospedreiro/gopsutil/pull/361 // https://github.com/shirou/gopsutil/pull/361
contents, err := ioutil.ReadFile(file) contents, err := ioutil.ReadFile(file)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -8,7 +8,7 @@ import (
"syscall" "syscall"
"testing" "testing"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -12,7 +12,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`) var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`)

View File

@ -6,7 +6,7 @@ import (
"runtime" "runtime"
"testing" "testing"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
func TestAddrString(t *testing.T) { func TestAddrString(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"context" "context"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
) )
// Return a list of network connections opened. // Return a list of network connections opened.

View File

@ -11,7 +11,7 @@ import (
"syscall" "syscall"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

View File

@ -7,9 +7,9 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/marcospedreiro/gopsutil/cpu" "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/mem" "github.com/shirou/gopsutil/mem"
) )
var ( var (

View File

@ -13,9 +13,9 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/marcospedreiro/gopsutil/cpu" "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/net" "github.com/shirou/gopsutil/net"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -6,9 +6,9 @@ import (
"context" "context"
"syscall" "syscall"
"github.com/marcospedreiro/gopsutil/cpu" "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/net" "github.com/shirou/gopsutil/net"
) )
type MemoryMapsStat struct { type MemoryMapsStat struct {

View File

@ -8,9 +8,9 @@ import (
"encoding/binary" "encoding/binary"
"strings" "strings"
cpu "github.com/marcospedreiro/gopsutil/cpu" cpu "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
net "github.com/marcospedreiro/gopsutil/net" net "github.com/shirou/gopsutil/net"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -15,10 +15,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/marcospedreiro/gopsutil/cpu" "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/host" "github.com/shirou/gopsutil/host"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/marcospedreiro/gopsutil/net" "github.com/shirou/gopsutil/net"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -10,10 +10,10 @@ import (
"strings" "strings"
"unsafe" "unsafe"
cpu "github.com/marcospedreiro/gopsutil/cpu" cpu "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
mem "github.com/marcospedreiro/gopsutil/mem" mem "github.com/shirou/gopsutil/mem"
net "github.com/marcospedreiro/gopsutil/net" net "github.com/shirou/gopsutil/net"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

View File

@ -12,7 +12,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -12,9 +12,9 @@ import (
"unsafe" "unsafe"
"github.com/StackExchange/wmi" "github.com/StackExchange/wmi"
cpu "github.com/marcospedreiro/gopsutil/cpu" cpu "github.com/shirou/gopsutil/cpu"
"github.com/marcospedreiro/gopsutil/internal/common" "github.com/shirou/gopsutil/internal/common"
net "github.com/marcospedreiro/gopsutil/net" net "github.com/shirou/gopsutil/net"
"github.com/shirou/w32" "github.com/shirou/w32"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )