Julian Kornberger
cfcaeee145
Use strconv.Itoa() instead of fmt.Sprintf() ( #1566 )
...
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
5 years ago
Ben Ye
2477c5c67d
switch to go-kit/log ( #1575 )
...
Signed-off-by: yeya24 <yb532204897@gmail.com>
5 years ago
ioriveur
17fee8081f
Check BSD's mib which accounts for swap size ( #1149 )
...
* Change Dfly's CPU counting frequency, see: https://github.com/prometheus/node_exporter/issues/1129
Signed-off-by: iori-yja <fivio.11235813@gmail.com>
* Convert Dfly's CPU unit into second
Signed-off-by: iori-yja <fivio.11235813@gmail.com>
* Check BSD's mib which accounts for swap size; see #1127
Signed-off-by: iori-yja <fivo.11235813@gmail.com>
* fix swap check code
Signed-off-by: iori-yja <fivo.11235813@gmail.com>
6 years ago
Mario Trangoni
c9f421d0dd
Fix some golint issues ( #927 )
...
* collector/cpu_*: rename nodeCpuSecondsDesc to nodeCPUSecondsDesc
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* collector/qdisc_linux.go: add NewQdiscStatCollector comment
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* collector/cpu_linux.go: rename core_map to coreMap
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
7 years ago
Ben Kochie
14d60958d6
Unify CPU collector conventions ( #806 )
...
* Unify CPU collector conventions
Add a common CPU metric description.
* All collectors use the same `nodeCpuSecondsDesc`.
* All collectors drop the `cpu` prefix for `cpu` label values.
* Fix subsystem string in cpu_freebsd.
* Fix Linux CPU freq label names.
7 years ago
Calle Pettersson
859a825bb8
Replace --collectors.enabled with per-collector flags ( #640 )
...
* Move NodeCollector into package collector
* Refactor collector enabling
* Update README with new collector enabled flags
* Fix out-of-date inline flag reference syntax
* Use new flags in end-to-end tests
* Add flag to disable all default collectors
* Track if a flag has been set explicitly
* Add --collectors.disable-defaults to README
* Revert disable-defaults flag
* Shorten flags
* Fixup timex collector registration
* Fix end-to-end tests
* Change procfs and sysfs path flags
* Fix review comments
7 years ago
Karsten Weiss
bca09abf1c
golint: Fix NewStatCollector() doc string.
8 years ago
stuart nelson
450fe0f3ba
Add test
8 years ago
stuart nelson
ee37a27d91
Export values as uint64_t
8 years ago
stuart nelson
e942d7e234
Maintain granularity in cpu data
...
Export cpu mode times as original uint64_t data,
and update frequency, and do the conversion to
float64 and subsequent division in go.
8 years ago
stuart nelson
57f88ac4f6
Update comment
8 years ago
stuart nelson
78c84b1a47
Remove old freq finding code
...
This is the code that was lifted from the freebsd
implementation, but was not correct.
8 years ago
stuart nelson
45ac033d9e
Use correct frequency for calculating cpu time
...
The correct frequency is the systimer frequency,
not the stathz.
From one of the DragonFly developers:
The bump upon each statclock is:
((cur_systimer - prev_systimer) * systimer_freq) >> 32
systimer_freq can be extracted from following
sysctl in userspace:
sysctl kern.cputimer.freq
8 years ago
stuart nelson
8cc06aab04
Remove unneeded ncpu variable
8 years ago
stuart nelson
9f7822ccdc
Remember to bzero string
...
Duplication was caused by malloc returning a
region of memory that already had data in it.
8 years ago
stuart nelson
c02dcdeb35
Remove unused comment.
8 years ago
stuart nelson
3e4a154656
Correctly exporting values
...
Moved to exporting via a string, which is then
split and parsed.
The string is sometimes duplicated, however.
8 years ago
stuart nelson
4b4385bd44
Remove free
...
Don't need it since we aren't malloc'ing
8 years ago
stuart nelson
cc5142a007
Remove some unnecessary includes
8 years ago
stuart nelson
a9d27ea722
Appears to be working? Still need to cleanup after self
8 years ago
stuart nelson
1d75b376ae
checkpoint
8 years ago
stuart nelson
1b7a18c271
Creating slice from C-array
...
Might not be lined up correctly? Weird output data
in the second CPU.
8 years ago
stuart nelson
03da1ea516
successfully exporting one of 2 cpus
8 years ago
stuart nelson
cda2f493ee
wip
8 years ago
Kai Storbeck
dcfbf40dbf
change caps of the constant
9 years ago
Kai Storbeck
365e688cec
gofmt, a typo, and an unintended change crept in
9 years ago
Kai Storbeck
aac89c524e
This should fix it.
9 years ago
Christian Schwarz
1fc84e2fb6
Re-implement CPU metrics collection through sysctls.
...
This removes the requirement to run `node_exporter` as root or with read
access to `/dev/kmem` in order to get CPU usage statistics.
Once FreeBSD adds a macro for the `kern.cp_times` sysctl, the
`setupSysctlMIBs()` function should be replaced by usage of the macro.
9 years ago
Brian Brazil
2f0d697f8c
Do a make format run.
9 years ago
Kirk Russell
89875cefe8
converted freebsd cpu metrics to seconds
9 years ago
Matthias Rampke
2d0d72b97d
Add license headers to all code files.
9 years ago
Siavash Safi
dddb273dfc
Fix some error messages.
9 years ago
Siavash Safi
f8ede82488
cpu: Fix build constraints.
9 years ago
Siavash Safi
462b708742
cpu: Code cleanup.
9 years ago
Siavash Safi
f7563fe7a2
Remove config from collectors.
9 years ago
Siavash Safi
a10ab2c102
Check caller's euid and egid when accessing /dev/mem on FreeBSD.
9 years ago
Siavash Safi
13d5f969a5
Removed freebsd build constraints from source code.
9 years ago
Siavash Safi
23bb9c44b9
Add cpu collector for FreeBSD.
9 years ago