Update vendoring (#685)

* Update vendor github.com/coreos/go-systemd/dbus@v15

* Update vendor github.com/ema/qdisc

* Update vendor github.com/godbus/dbus

* Update vendor github.com/golang/protobuf/proto

* Update vendor github.com/lufia/iostat

* Update vendor github.com/matttproud/golang_protobuf_extensions/pbutil@v1.0.0

* Update vendor github.com/prometheus/client_golang/...

* Update vendor github.com/prometheus/common/...

* Update vendor github.com/prometheus/procfs/...

* Update vendor github.com/sirupsen/logrus@v1.0.3

Adds vendor golang.org/x/crypto

* Update vendor golang.org/x/net/...

* Update vendor golang.org/x/sys/...

* Update end to end output.
This commit is contained in:
Ben Kochie 2017-10-05 16:20:47 +02:00 committed by GitHub
commit deadfef4c9
283 changed files with 47085 additions and 29054 deletions

View file

@ -1,14 +1,16 @@
#include <stdint.h>
#include <CoreFoundation/CoreFoundation.h>
#include "iostat_darwin.h"
#define IOKIT 1 /* to get io_name_t in device_types.h */
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
#include <mach/mach_host.h>
static int getdrivestat(io_registry_entry_t d, DriveStats *stat);
static int fillstat(io_registry_entry_t d, DriveStats *stat);
@ -126,3 +128,23 @@ fillstat(io_registry_entry_t d, DriveStats *stat)
CFRelease(props);
return 0;
}
int
readcpustat(CPUStats *stats)
{
mach_port_t port;
host_cpu_load_info_data_t load;
mach_msg_type_number_t n;
kern_return_t status;
port = mach_host_self();
n = HOST_CPU_LOAD_INFO_COUNT;
status = host_statistics(port, HOST_CPU_LOAD_INFO, (host_info_t)&load, &n);
if(status != KERN_SUCCESS)
return -1;
stats->user = load.cpu_ticks[CPU_STATE_USER];
stats->nice = load.cpu_ticks[CPU_STATE_NICE];
stats->sys = load.cpu_ticks[CPU_STATE_SYSTEM];
stats->idle = load.cpu_ticks[CPU_STATE_IDLE];
return 0;
}