Skip to content

Commit

Permalink
workaround kernel /proc/self bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mats cronqvist committed Jun 21, 2012
1 parent 29edce5 commit 16bae32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dtopConsumer.erl
Expand Up @@ -116,9 +116,14 @@ resize(Items,Prcs) ->
end.

cpu_per_red(Sys) ->
CPU =
case lks(beam_user,Sys,1)+lks(beam_kernel,Sys,0) of
0.0 -> 1;
C -> C
end,
case lks(reductions,Sys) of
0 -> 0;
Reds -> 100*(lks(beam_user,Sys,1)+lks(beam_kernel,Sys,0))/Reds
Reds -> 100*CPU/Reds
end.

procsI(FD,PP,CpuPerRed) ->
Expand Down

0 comments on commit 16bae32

Please sign in to comment.