168 reputation
7
bio website kbrandt.com
location Hollywood, FL
age 31
visits member for 3 years
seen Apr 18 at 1:26

After about a year of being a member of the community I am now Stack Overflow Valued Associate #9 (Or Server Fault Valued Associate #1 if you like).

Besides trying to keep these sites up I will also be writing posts for the [Server Fault Blog][2].

[2]: http://blog.serverfault.com/

@KyleMBrandt


Apr
9
awarded  Scholar
Apr
9
revised How to get CPU Percentage as a Counter?
added 74 characters in body
Apr
9
accepted How to get CPU Percentage as a Counter?
Apr
9
comment How to get CPU Percentage as a Counter?
This seems to work. I'm using opentsdb, which does a rate calculation for me from counters, so all I need to do is send it user+nice+system from the first line of /proc/stat divided by the number of cores. Whatever bug is messing with /proc/uptime doesn't seem to impact /proc/stat.
Apr
9
comment How to get CPU Percentage as a Counter?
@TAFKA'goldilocks': Do you what subset of the /proc/stat columns summed equals utilization? Is it user/system/nice?
Apr
9
awarded  Commentator
Apr
9
comment How to get CPU Percentage as a Counter?
@psusi: When I take two samples, and turn that into a per/second rate, I end up with centiseconds utlized per second. So for example, I would get 75 centiseconds per second. A second has 100 centiseconds. 75/100*100=75. Hence it the number is the same, regardless of what you want to call it.
Apr
9
comment How to get CPU Percentage as a Counter?
@TAFKA'goldilocks': Good idea, I'll do the math from /proc/stat and see if I run into this same bug on the machine exhibiting the behavior.
Apr
9
comment How to get CPU Percentage as a Counter?
@TAFKA'goldilocks': According to your answer uptime * num_core - idle_time = total active processor seconds. Doesn't it logically follow that total active processor seconds should never decrease?
Apr
9
comment How to get CPU Percentage as a Counter?
@psusi: If you divide by uptime it is no longer a counter, what I want is a counter.
Apr
9
comment How to get CPU Percentage as a Counter?
@psusi: In a per second rate, that maximum number of centi seconds in a second is 100. So it basically "works out". But this is kind of tangential. My problem seems to be that "total busy time" goes down over time as per my update.
Apr
9
revised How to get CPU Percentage as a Counter?
added 84 characters in body
Apr
9
comment How to get CPU Percentage as a Counter?
@TAFKA 'goldilocks': Also, "calculates an abstraction of busy time in centiseconds" is a good way of putting it. I sample that and get that number, sample it again later and get what should be a higher number, then take (sample2_value-sample1_value)/(sample2_time-sample1_time) to get a per second rate of utilization. Having it centiseconds makes it a "percentage"
Apr
9
comment How to get CPU Percentage as a Counter?
@Graeme: nproc outputs 16. My guess is some sort of bug as well, which is why I was wondering if there is a more reliable source
Apr
9
comment How to get CPU Percentage as a Counter?
@TAFKA'goldilocks': Updated my question
Apr
9
revised How to get CPU Percentage as a Counter?
added 450 characters in body
Apr
9
comment How to get CPU Percentage as a Counter?
The metric I'm going for is a monotonically increasing counter of utilization, so on the query side I can take the deltas, divide by total seconds, and get a rate.
Apr
9
comment How to get CPU Percentage as a Counter?
Nope, it my actual code it is a single read: [kbrandt@ny-lb06: ~] read uptime idle </proc/uptime; echo -e "scale=10\n ($uptime-($idle/16))*100" | bc <990@8:03> 6259851.5000000000 [kbrandt@ny-lb06: ~] read uptime idle </proc/uptime; echo -e "scale=10\n ($uptime-($idle/16))*100" | bc <991@8:03> 6259842.8125000000
Apr
9
asked How to get CPU Percentage as a Counter?
Jan
30
revised What is the Inverse of Idle in /proc/stat?
deleted 3 characters in body