Remote 'stats' API shows not enough data for the memory and CPU for Windows #28300
Closed
Description
Description
When I try to use remote API 'stats' it does not return me required information in cpu_stats/precpu_stats/memory_stats.
Steps to reproduce the issue:
- I configured dockerd to listen 2375 port by setting following option in the daemon.json
"hosts": ["tcp://0.0.0.0:2375", "npipe://"]
- When I'm loading an information from the url http://(ip):2375/containers/(container name)/stats it returns me following information
{
"read":"2016-11-10T17:09:05.9645078Z",
"preread":"2016-11-10T17:09:04.9644977Z",
"pids_stats":{
},
"blkio_stats":{
"io_service_bytes_recursive":null,
"io_serviced_recursive":null,
"io_queue_recursive":null,
"io_service_time_recursive":null,
"io_wait_time_recursive":null,
"io_merged_recursive":null,
"io_time_recursive":null,
"sectors_recursive":null
},
"num_procs":32,
"storage_stats":{
"read_count_normalized":5041,
"read_size_bytes":37215744,
"write_count_normalized":4127,
"write_size_bytes":30659072
},
"cpu_stats":{
"cpu_usage":{
"total_usage":119761718750,
"usage_in_kernelmode":44129062500,
"usage_in_usermode":44129062500
},
"throttling_data":{
"periods":0,
"throttled_periods":0,
"throttled_time":0
}
},
"precpu_stats":{
"cpu_usage":{
"total_usage":119753906250,
"usage_in_kernelmode":44126093750,
"usage_in_usermode":44126093750
},
"throttling_data":{
"periods":0,
"throttled_periods":0,
"throttled_time":0
}
},
"memory_stats":{
"commitbytes":128905216,
"commitpeakbytes":155820032,
"privateworkingset":88584192
},
"networks":{
"f6b5e0fe-c67b-48ab-93be-523ad5e8d9d3":{
"rx_bytes":625737,
"rx_packets":1636,
"rx_errors":0,
"rx_dropped":0,
"tx_bytes":351044,
"tx_packets":1186,
"tx_errors":0,
"tx_dropped":0
}
}
}
As you can see it is quite different with expected output described in the documentation ( https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/ ).
Few important points from me:
- For the cpu_stats/precpu_stats it does not contain at least "system_cpu_usage" so we can not calculate cpu percentage for the particular container
- For the memory_stats we only see three variables commitbytes/commitpeakbytes/privateworkingset which are not description in the documentation. I expected at least max_usage/usage variables and sub-variable "stats"
Output of docker version
:
Client:
Version: 1.12.2-cs2-ws-beta
API version: 1.25
Go version: go1.7.1
Git commit: 050b611
Built: Tue Oct 11 02:35:40 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.2-cs2-ws-beta
API version: 1.25
Go version: go1.7.1
Git commit: 050b611
Built: Tue Oct 11 02:35:40 2016
OS/Arch: windows/amd64
Output of docker info
:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1
Server Version: 1.12.2-cs2-ws-beta
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: nat null overlay
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.321.amd64fre.rs1_release_inmarket.161004-2338)
Operating System: Windows Server 2016 Datacenter
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 4 GiB
Name: EC2AMAZ-P7L1INT
ID: 6JSQ:WIFX:QJ25:TM5T:JBOG:CR7M:NSOW:X2AJ:QJXR:PRID:CLE2:6Q67
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (AWS, VirtualBox, physical, etc.):
It is a EC2 instance which was launched from "Windows Server 2016 with containers image"