Timothy Jans wrote:
> The CPU & Memory Usage in 1.2b1 are really awesome,
> they are just so much better then the previous load averages.
> I'm interested, how did you generate the CPU & Memory Usage?
The CPU usage is calculated using /sbin/sysctl kern.cp_time.
This is called two times with one second pause between. The command
returns cpu time used by: user, nice, sys, intr and idle. With this
information we can calculate the CPU usage.
The memory usage is also calculated using sysctl.
If you request vm.stats.vm.v_active_count, vm.stats.vm.v_inactive_count,
vm.stats.vm.v_wire_count, vm.stats.vm.v_cache_count and
vm.stats.vm.v_free_count it's not difficult to calculate how much free
memory you have. :)
O (=> Audun Larsen
)/\,_[__] Larsen Konsult