Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,858 changes: 1,503 additions & 1,355 deletions plugins/inputs/docker/docker_test.go

Large diffs are not rendered by default.

589 changes: 0 additions & 589 deletions plugins/inputs/docker/docker_testdata.go

This file was deleted.

66 changes: 66 additions & 0 deletions plugins/inputs/docker/testdata/disk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"LayersSize": 10000000000,
"Images": [
{
"Containers": 0,
"Created": 0,
"Id": "sha256:some_imageid",
"Labels": null,
"ParentId": "",
"RepoDigests": null,
"RepoTags": [
"some_image_tag:1.0.0-alpine"
],
"SharedSize": 0,
"Size": 123456789
},
{
"Containers": 0,
"Created": 0,
"Id": "sha256:7f4a1cc74046ce48cd918693cd6bf4b2683f4ce0d7be3f7148a21df9f06f5b5f",
"Labels": null,
"ParentId": "",
"RepoDigests": null,
"RepoTags": [
"telegraf:latest"
],
"SharedSize": 0,
"Size": 425484494
}
],
"Containers": [
{
"Id": "",
"Names": [
"/some_container"
],
"Image": "some_image:1.0.0-alpine",
"ImageID": "",
"Command": "",
"Created": 0,
"Ports": null,
"SizeRootFs": 123456789,
"Labels": null,
"State": "",
"Status": "",
"HostConfig": {},
"NetworkSettings": null,
"Mounts": null
}
],
"Volumes": [
{
"Driver": "",
"Labels": null,
"Mountpoint": "",
"Name": "some_volume",
"Options": null,
"Scope": "",
"UsageData": {
"RefCount": 0,
"Size": 123456789
}
}
],
"BuildCache": null
}
161 changes: 161 additions & 0 deletions plugins/inputs/docker/testdata/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"ID": "5WQQ:TFWR:FDNG:OKQ3:37Y4:FJWG:QIKK:623T:R3ME:QTKB:A7F7:OLHD",
"Containers": 108,
"ContainersRunning": 98,
"ContainersPaused": 3,
"ContainersStopped": 6,
"Images": 199,
"Driver": "devicemapper",
"DriverStatus": [
[
"Pool Name",
"docker-8:1-1182287-pool"
],
[
"Base Device Size",
"10.74 GB"
],
[
"Pool Blocksize",
"65.54 kB"
],
[
"Backing Filesystem",
"extfs"
],
[
"Data file",
"/dev/loop0"
],
[
"Metadata file",
"/dev/loop1"
],
[
"Data Space Used",
"17.3 GB"
],
[
"Data Space Total",
"107.4 GB"
],
[
"Data Space Available",
"36.53 GB"
],
[
"Metadata Space Used",
"20.97 MB"
],
[
"Metadata Space Total",
"2.147 GB"
],
[
"Metadata Space Available",
"2.127 GB"
],
[
"Udev Sync Supported",
"true"
],
[
"Deferred Removal Enabled",
"false"
],
[
"Data loop file",
"/var/lib/docker/devicemapper/devicemapper/data"
],
[
"Metadata loop file",
"/var/lib/docker/devicemapper/devicemapper/metadata"
],
[
"Library Version",
"1.02.115 (2016-01-25)"
],
[
"Thin Pool Minimum Free Space",
"10.74GB"
]
],
"Plugins": {
"Volume": null,
"Network": null,
"Authorization": null,
"Log": null
},
"MemoryLimit": false,
"SwapLimit": false,
"CpuCfsPeriod": true,
"CpuCfsQuota": true,
"CPUShares": false,
"CPUSet": false,
"PidsLimit": false,
"IPv4Forwarding": true,
"Debug": false,
"NFd": 19,
"OomKillDisable": false,
"NGoroutines": 39,
"SystemTime": "2016-02-24T00:55:09.15073105-05:00",
"LoggingDriver": "json-file",
"CgroupDriver": "",
"NEventsListener": 0,
"KernelVersion": "4.3.0-1-amd64",
"OperatingSystem": "Linux Mint LMDE (containerized)",
"OSVersion": "",
"OSType": "",
"Architecture": "",
"IndexServerAddress": "https://index.docker.io/v1/",
"RegistryConfig": {
"IndexConfigs": {
"docker.io": {
"Mirrors": [],
"Name": "docker.io",
"Official": true,
"Secure": true
}
},
"InsecureRegistryCIDRs": [
"127.0.0.0/8"
],
"Mirrors": []
},
"NCPU": 4,
"MemTotal": 3840757760,
"GenericResources": null,
"DockerRootDir": "/var/lib/docker",
"HttpProxy": "",
"HttpsProxy": "",
"NoProxy": "",
"Name": "absol",
"Labels": [],
"ExperimentalBuild": false,
"ServerVersion": "17.09.0-ce",
"Runtimes": null,
"DefaultRuntime": "",
"Swarm": {
"NodeID": "",
"NodeAddr": "",
"LocalNodeState": "",
"ControlAvailable": false,
"Error": "",
"RemoteManagers": null
},
"LiveRestoreEnabled": false,
"Isolation": "",
"InitBinary": "",
"ContainerdCommit": {
"ID": ""
},
"RuncCommit": {
"ID": ""
},
"InitCommit": {
"ID": ""
},
"SecurityOptions": null,
"CDISpecDirs": null,
"Warnings": null
}
73 changes: 73 additions & 0 deletions plugins/inputs/docker/testdata/inspect.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"Id": "",
"Created": "",
"Path": "",
"Args": null,
"State": {
"Status": "running",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1234,
"ExitCode": 0,
"Error": "",
"StartedAt": "2018-06-14T05:48:53.266176036Z",
"FinishedAt": "0001-01-01T00:00:00Z",
"Health": {
"Status": "Unhealthy",
"FailingStreak": 1,
"Log": null
}
},
"Image": "",
"ResolvConfPath": "",
"HostnamePath": "",
"HostsPath": "",
"LogPath": "",
"Name": "",
"RestartCount": 0,
"Driver": "",
"Platform": "",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": null,
"GraphDriver": {
"Data": null,
"Name": ""
},
"Mounts": null,
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"ENVVAR1=loremipsum",
"ENVVAR1FOO=loremipsum",
"ENVVAR2=dolorsitamet",
"ENVVAR3==ubuntu:10.04",
"ENVVAR4",
"ENVVAR5=",
"ENVVAR6= ",
"ENVVAR7=ENVVAR8=ENVVAR9",
"PATH=/bin:/sbin"
],
"Cmd": null,
"Image": "",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
"NetworkSettings": null
}
Loading
Loading