[Dev] Re: current Mac Monitor status
Frank Cohen
fcohen at pushtotest.com
Tue May 15 11:12:05 PDT 2007
Mac OS X has some of the BSD Unix utilities. Here's what you should
be using:
iostat - gives cpu usage
vm_stat - gives memory
netstat - gives network activity
-Frank
On May 15, 2007, at 10:21 AM, William Martínez Pomares wrote:
>
> FYI
>> -----Original Message-----
>> From: Luis Carlos Lara López
>> Sent: Tuesday, May 15, 2007 9:50 AM
>> To: William Martínez Pomares
>> Subject: current Mac Monitor stated
>> Importance: High
>>
>> Unix monitor: Current state
>>
>> The Mac and Linux Monitor are a derivation from the Windows
>> monitor, only that this monitor uses the system command to obtain
>> the required information. The command used is TOP
>>
>> TOP in Mac (top -l 1) shows and output like
>>
>> Processes: 47 total, 2 running, 45 sleeping... 137
>> threads 09:34:12
>> Load Avg: 1.45, 1.02, 0.86 CPU usage: 22.4% user, 77.6% sys,
>> 0.0% idle
>> SharedLibs: num = 143, resident = 24.1M code, 2.54M data, 3.84M
>> LinkEdit
>> MemRegions: num = 3336, resident = 123M + 6.70M private, 24.4M
>> shared
>> PhysMem: 35.7M wired, 140M active, 70.8M inactive, 246M used,
>> 9.18M free
>> VM: 2.26G + 96.4M 14714(0) pageins, 265(0) pageouts
>>
>> PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD
>> RSIZE VSIZE
>> 23840 top 0.0% 0:00.16 1 17 20 188K 332K
>> 608K 26.9M
>> 21749 mdimport 0.0% 0:01.64 3 60 51 912K 1.43M
>> 2.82M 38.3M
>> 10500 bash 0.0% 0:00.74 1 14 18 204K 784K
>> 852K 27.1M
>> 10499 login 0.0% 0:00.04 1 16 38 168K 352K
>> 568K 26.9M
>> 3487 bash 0.0% 0:02.76 1 14 17 208K 784K
>> 588K 27.1M
>> 3486 login 0.0% 0:00.04 1 16 38 168K 352K
>> 568K 26.9M
>> 2724 Terminal 0.0% 4:09.64 7 165 179 3.84M 6.96M
>> 10.1M 90.1M
>> 210 OSXvnc-ser 0.0% 63:49.54 4 98 104 27.4M 1.85M
>> 29.3M 97.7M
>> 192 Share My D 0.0% 16:09.24 1 66 140 63.1M 5.12M
>> 67.3M 137M
>> 190 System Eve 0.0% 0:07.05 1 56 59 920K 1.08M
>> 2.70M 45.8M
>>
>> TOP in Linux (top -n 1) it shows and output like
>>
>>
>> top - 09:23:35 up 17 days, 18:08, 2 users, load average: 0.21,
>> 0.19, 0.17
>> Tasks: 129 total, 1 running, 128 sleeping, 0 stopped, 0 zombie
>> Cpu(s): 22.6%us, 0.3%sy, 0.0%ni, 76.8%id, 0.1%wa, 0.1%hi, 0.0%
>> si, 0.0%st
>> Mem: 514156k total, 502532k used, 11624k free, 110556k
>> buffers
>> Swap: 525288k total, 88k used, 525200k free, 176160k
>> cached
>>
>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
>> 8219 llara 15 0 2152 992 740 R 5.6 0.2 0:00.06 top
>> 27244 mysql 18 0 187m 32m 4600 S 1.9 6.5 5714:41 mysqld
>> 1 root 15 0 2028 728 628 S 0.0 0.1 0:01.39 init
>>
>>
>> With that information we can obtain the CPU and Memory statistic,
>> nevertheless the NET information is not present. We continue
>> looking for a command that allows us to get the Network data.
>>
>> Approach shortcomings
>>
>> * TOP output is processed using grep command. Both commands must
>> be present for the monitor to work.
>> * The output is processed using regular expression. If the output
>> differs considerably between flavors of Linux and Mac, more
>> complex GREP Regular Expressions must be made to get the required
>> information.
>>
>>
>>
--
Frank Cohen, PushToTest, http://www.PushToTest.com, phone 408 374 7426
TestMaker: The open-source SOA test automation tool
More information about the Dev
mailing list