Tivan is dead, long live Telegraf. Fixes #3
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package all
|
||||
|
||||
import (
|
||||
_ "github.com/influxdb/tivan/plugins/mysql"
|
||||
_ "github.com/influxdb/tivan/plugins/postgresql"
|
||||
_ "github.com/influxdb/tivan/plugins/redis"
|
||||
_ "github.com/influxdb/tivan/plugins/system"
|
||||
_ "github.com/influxdb/telegraf/plugins/mysql"
|
||||
_ "github.com/influxdb/telegraf/plugins/postgresql"
|
||||
_ "github.com/influxdb/telegraf/plugins/redis"
|
||||
_ "github.com/influxdb/telegraf/plugins/system"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type Mysql struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/tivan/testutil"
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ package postgresql
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ package postgresql
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/tivan/testutil"
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type Redis struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/tivan/testutil"
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ package system
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type CPUStats struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package system
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type DiskStats struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package system
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type DockerStats struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package system
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type MemStats struct {
|
||||
|
||||
@@ -2,12 +2,12 @@ package system
|
||||
|
||||
import "github.com/stretchr/testify/mock"
|
||||
|
||||
import "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
import "github.com/influxdb/tivan/plugins/system/ps/disk"
|
||||
import "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
import "github.com/influxdb/telegraf/plugins/system/ps/disk"
|
||||
|
||||
import "github.com/influxdb/tivan/plugins/system/ps/load"
|
||||
import "github.com/influxdb/tivan/plugins/system/ps/mem"
|
||||
import "github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
import "github.com/influxdb/telegraf/plugins/system/ps/load"
|
||||
import "github.com/influxdb/telegraf/plugins/system/ps/mem"
|
||||
import "github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
|
||||
type MockPS struct {
|
||||
mock.Mock
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
)
|
||||
|
||||
type NetIOStats struct {
|
||||
@@ -18,7 +18,7 @@ func (_ *NetIOStats) Description() string {
|
||||
}
|
||||
|
||||
var netSampleConfig = `
|
||||
# By default, tivan gathers stats from any up interface (excluding loopback)
|
||||
# By default, telegraf gathers stats from any up interface (excluding loopback)
|
||||
# Setting interfaces will tell it to gather these explicit interfaces,
|
||||
# regardless of status.
|
||||
#
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
"strings"
|
||||
|
||||
dc "github.com/fsouza/go-dockerclient"
|
||||
"github.com/influxdb/tivan/plugins"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/disk"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/docker"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/load"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/mem"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/disk"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/docker"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/load"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/mem"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
)
|
||||
|
||||
type DockerContainerStat struct {
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
// sys/resource.h
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
// sys/resource.h
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func CPUTimes(percpu bool) ([]CPUTimesStat, error) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
// TODO: Get percpu
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func TestDisk_usage(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
)
|
||||
|
||||
// GetDockerIDList returnes a list of DockerID.
|
||||
|
||||
@@ -5,8 +5,8 @@ package docker
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
)
|
||||
|
||||
// GetDockerIDList returnes a list of DockerID.
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func HostInfo() (*HostInfoStat, error) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
type LSB struct {
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
process "github.com/influxdb/tivan/plugins/system/ps/process"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
process "github.com/influxdb/telegraf/plugins/system/ps/process"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ package load
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func LoadAvg() (*LoadAvgStat, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ package load
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func LoadAvg() (*LoadAvgStat, error) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
package load
|
||||
|
||||
import (
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func LoadAvg() (*LoadAvgStat, error) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func getPageSize() (uint64, error) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func VirtualMemory() (*VirtualMemoryStat, error) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func VirtualMemory() (*VirtualMemoryStat, error) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func NetIOCounters(pernic bool) ([]NetIOCountersStat, error) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
// NetIOCounters returnes network I/O statistics for every network
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
cpu "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
)
|
||||
|
||||
type Process struct {
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
)
|
||||
|
||||
// copied from sys/sysctl.h
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"encoding/binary"
|
||||
"unsafe"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
)
|
||||
|
||||
// MemoryInfoExStat is different between OSes
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
host "github.com/influxdb/tivan/plugins/system/ps/host"
|
||||
net "github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
host "github.com/influxdb/telegraf/plugins/system/ps/host"
|
||||
net "github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
)
|
||||
|
||||
func testGetProcess() Process {
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
|
||||
"github.com/shirou/w32"
|
||||
|
||||
common "github.com/influxdb/tivan/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
common "github.com/influxdb/telegraf/plugins/system/ps/common"
|
||||
cpu "github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
net "github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package system
|
||||
|
||||
import "github.com/influxdb/tivan/plugins"
|
||||
import "github.com/influxdb/telegraf/plugins"
|
||||
|
||||
type SystemStats struct {
|
||||
ps PS
|
||||
|
||||
@@ -3,13 +3,13 @@ package system
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/tivan/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/disk"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/docker"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/load"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/mem"
|
||||
"github.com/influxdb/tivan/plugins/system/ps/net"
|
||||
"github.com/influxdb/tivan/testutil"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/cpu"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/disk"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/docker"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/load"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/mem"
|
||||
"github.com/influxdb/telegraf/plugins/system/ps/net"
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user