Skip to content

Commit

Permalink
Oops, T:I:Usage.cpus didn't work in reports
Browse files Browse the repository at this point in the history
- because it was missing from T:I:Usage.formats
- also slightly speed up calculation
  • Loading branch information
lizmat committed Nov 13, 2017
1 parent e591233 commit de961b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Telemetry.pm6
Expand Up @@ -74,6 +74,8 @@ class Telemetry::Instrument::Usage does Telemetry::Instrument {
'The amount of CPU used in user code (in microseconds)'
>>,<< cpu-sys 8d
'The amount of CPU used in system overhead (in microseconds)'
>>,<< cpus 5.1f
"The number of CPU's that were busy on average"
>>,<< id-rss 8d
'Integral unshared data size (in Kbytes)'
>>,<< inb 4d
Expand Down Expand Up @@ -187,8 +189,8 @@ HEADER
+ nqp::atpos_i(data,STIME_MSEC)
}
%dispatch<cpus> = -> Mu \data {
(my int $wallclock = nqp::atkey($dispatch,'wallclock')(data))
?? nqp::atkey($dispatch,'cpu')(data) / $wallclock
(my int $wallclock = nqp::atpos_i(data,WALLCLOCK))
?? (nqp::atkey($dispatch,'cpu')(data) / $wallclock)
!! $cores
}
%dispatch<util%> = -> Mu \data {
Expand Down

0 comments on commit de961b8

Please sign in to comment.