PDA

View Full Version : Measure CPU?


babelfishi
2006-08-09, 13:39
When I run my Java app in full-screen, I have no idea how much CPU it is taking up. Is there any way to log the CPU activities when I'm in full-screen (via terminal or something) ?

chucker
2006-08-09, 13:48
When I run my Java app in full-screen,

:err: Should I even ask?

Is there any way to log the CPU activities when I'm in full-screen (via terminal or something) ?

Yeah, use another computer and log in via SSH, then run top.

babelfishi
2006-08-09, 13:53
Two things:
Yeah, use another computer and log in via SSH, then run top.

1. That's rather annoying. Does that work with Ubuntu Linux / Windows XP?

2. No better way?

Windowsrookie
2006-08-09, 13:55
Applications>Utilities>Activity Monitor

babelfishi
2006-08-09, 13:57
I know that, but it doesn't give a huge history of CPU usage.

Kickaha
2006-08-09, 13:57
That was what I deleted down below. He's fullscreen. ;)

chucker
2006-08-09, 13:58
Two things:


1. That's rather annoying. Does that work with Ubuntu Linux / Windows XP?

Yes. Ubuntu includes an SSH client. For Windows, you'll have to install one.

2. No better way?

Um, no, of course not. If you're filling the screen, you're gonna have to use another screen.

Kickaha
2006-08-09, 14:02
Or...

Before you start your app, enter the Terminal and type 'top -l 0 > toplog'.

When you're done, go back to that Terminal window and Ctrl-C to quit top.

'toplog' will be a raw file with all the data. Use your favorite data scraper to parse out what you want.

babelfishi
2006-08-09, 14:07
chris-computer:~ $ top -l 0 > toplog
^C
chris-computer:~ $ toplog
-bash: toplog: command not found


Err?

Kickaha
2006-08-09, 14:10
'more toplog'

bassplayinMacFiend
2006-08-09, 14:14
toplog is a text file, not a program. more is a program that will read toplog, although you might want to use less because less is indeed more than more.

Kickaha
2006-08-09, 14:14
Oh don't confuse the poor guy!

Bryson
2006-08-09, 14:57
More cowbell, surely?

I'll get me coat.