aboutsummaryrefslogtreecommitdiff
path: root/collector/loadavg_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'collector/loadavg_unix.go')
-rw-r--r--collector/loadavg_unix.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/collector/loadavg_unix.go b/collector/loadavg_unix.go
deleted file mode 100644
index 4d65885..0000000
--- a/collector/loadavg_unix.go
+++ /dev/null
@@ -1,33 +0,0 @@
1// Copyright 2015 The Prometheus Authors
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14// +build darwin dragonfly netbsd openbsd
15// +build !noloadavg
16
17package collector
18
19import (
20 "errors"
21)
22
23// #include <stdlib.h>
24import "C"
25
26func getLoad() ([]float64, error) {
27 var loadavg [3]C.double
28 samples := C.getloadavg(&loadavg[0], 3)
29 if samples != 3 {
30 return nil, errors.New("failed to get load average")
31 }
32 return []float64{float64(loadavg[0]), float64(loadavg[1]), float64(loadavg[2])}, nil
33}