-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu_dragonfly.go
's cpu time doesn't seem to be in second against its name (node_cpu_seconds_total)
#1129
Comments
This was introduced in #310 - @stuartnelson3 Can you clarify this? No clue about Drgonflybsd unfortunately.. |
I asked that question (a looong time ago 😄 ) on the dfly mailing list: http://lists.dragonflybsd.org/pipermail/users/2016-September/356968.html It's something I could have easily done wrong. At the time, it seemed to get the right values on my system, but it could (and seems to) be wrong. |
Thank you, @stuartnelson3... it is curious that the answer turned out wrong. I have submitted a Pull request #1140 which works on my machine. I'm happy if you would be kind to check this on your environment. |
Signed-off-by: iori-yja <fivio.11235813@gmail.com>
Signed-off-by: iori-yja <fivio.11235813@gmail.com>
Signed-off-by: iori-yja <fivo.11235813@gmail.com>
* Change Dfly's CPU counting frequency, see: #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>
* Change Dfly's CPU counting frequency, see: #1129 * Convert Dfly's CPU unit into second Signed-off-by: iori-yja <fivo.11235813@gmail.com>
* Change Dfly's CPU counting frequency, see: prometheus#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 prometheus#1127 Signed-off-by: iori-yja <fivo.11235813@gmail.com> * fix swap check code Signed-off-by: iori-yja <fivo.11235813@gmail.com>
* Change Dfly's CPU counting frequency, see: prometheus#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 prometheus#1127 Signed-off-by: iori-yja <fivo.11235813@gmail.com> * fix swap check code Signed-off-by: iori-yja <fivo.11235813@gmail.com>
Host operating system: output of
uname -a
DragonFly tech-y09-dfly 5.3-DEVELOPMENT DragonFly v5.3.0.18494.gc70d4-DEVELOPMENT #1: Fri Aug 24 12:27:12 JST 2018 root@tech-y09-dfly:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
node_exporter version: output of
node_exporter --version
Installed from source.
iori@tech-y09-dfly% git log | head -n 3
commit 7519967
Author: Ben Kochie superq@gmail.com
Date: Sat Oct 20 08:21:51 2018 +0200
iori@tech-y09-dfly% node_exporter --version
node_exporter, version (branch: , revision: )
build user:
build date:
go version: go1.10.3
node_exporter command line flags
node_exporter
(default)Are you running node_exporter in Docker?
No
What did you do that produced an error?
Just run.
What did you expect to see?
The
node_cpu_seconds_total
metrics are in seconds.What did you see instead?
The total sum of irate of reported metrics are around 40ms which is too smaller than expected (this should be 1 second * ncpu).
The cause
According to cpu_dragonfly.go, the metrics are extracted from
kern.cputime
and divided by the frequency ofkern.cputimer.freq
.However, the comment in the source code states that it counts in microseconds.
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/kern/kern_clock.c#L118
The comment is consistent with a shell script as following:
This machine has four cores, so the timer goes around 1000k ticks per CPU in a second, which implies the kernel counts it in microseconds.
I'd like to know why they are divided by that frequency instead of 1/micros.
The text was updated successfully, but these errors were encountered: