Solved

CPU Usage without JNI?

Posted on 2004-08-23
21
5,240 Views
Last Modified: 2012-05-05
Hi all,
is it possible to record the Processors Usage without involving JNI? :o\
If so, how please?
Else, is there a utility that records the CPU usage? ie, and outputs to a file, or something...??

I'm going to be running and testing my DirectX games and any other software that I make, and would like to record the CPU usage during it..
However, the games will run a Full Screen. Thus, I cannot simply load the Task Manager > "Performance", then keep print screening the area, and trim it. So... I'm sure you get what I mean.  :o)

Any ideas?
thanks!
[r.D]
0
Comment
Question by:DrWarezz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 4
  • +4
21 Comments
 
LVL 9

Author Comment

by:DrWarezz
ID: 11868570
BTW:
  OS: Windows XP home edition
  Java v: 1.4

:o) [r.D]
0
 
LVL 35

Expert Comment

by:girionis
ID: 11868581
I am afraid this is not possible :(
0
 
LVL 92

Expert Comment

by:objects
ID: 11868593
Find a utility that provides what you need and call it using Runtime.exec()
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 9

Author Comment

by:DrWarezz
ID: 11868594
:o(  Oh.
Are there no utilities that you know of that do this?? :o\

Thanks girionis. :o)
[r.D]
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 11868600
Argh. Well, I'm fine to do that; but I haven't yet found any utilities.. I shall go and have a better look now.. I don't suppose any of you know of one? :o\

ta - [r.D]
0
 
LVL 92

Expert Comment

by:objects
ID: 11868614
perhaps ask in windows topic.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11868616
Why don't you want to use JNI? Using a utility instead will be the same thing.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11868623
Why not JNI?
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 11868645
Well, I've never actually used JNI.
It doesn't seem the easiest job. :o\  So, I keep putting it off.
So, unless someone is willing to talk me through using JNI to do exactly what I need here.. then; You know :o\

I've been given this tutorial: http://java.sun.com/docs/books/tutorial/native1.1/index.html
But haven't used it yet  :o\

:o)
[r.D]
0
 
LVL 20

Accepted Solution

by:
Venabili earned 45 total points
ID: 11868658
Well... You may find that it is not THAT hard in this case:) Check this article
http://www.javaworld.com/javaworld/javaqa/2002-11/01-qa-1108-cpu.html
0
 
LVL 35

Expert Comment

by:girionis
ID: 11868671
0
 
LVL 12

Expert Comment

by:Giant2
ID: 11868737
To know the CPU USAGE you can use SNMP.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11868762
girionis,

Just to mention that in the question which link you posted, the Answerer had COPIED the whole article which link I posted(without credit to the original :( )

0
 
LVL 35

Expert Comment

by:girionis
ID: 11868777
Yes you are right, I just saw it... So DrWarezz kudos (and points) should go to Venabili :)
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11868790
Heh..no probs with the points :) Just wanted to point out the strange situation.... However - I added also a comment in the old question so whoever find it to know where this comes from....
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 11868994
Okay sure.
However; I've downloaded the source code from the site linked to by Venabili. And I haven't quite got it to work yet.. I don't get exactly in what directories relative to the main file the other pieces of code must go, etc.. :o\  Nore exactly how to use it.. Once I've got that working, then points will be rewarded.

Does anyone know off their head the locations that everything must go?  ie; could you type up a dir tree to demonstrate?? :o)

Thanks!
[r.D]
0
 
LVL 35

Expert Comment

by:girionis
ID: 11869033
I think you mainly need the library path which is indicated in this line (the java.library.path property):

>java -Djava.library.path=. -cp silib.jar;(my JDK install

The rest of the classes should be in your classpath.
0
 
LVL 7

Expert Comment

by:grim_toaster
ID: 11878875
If you are happy with the task-manager/performance style of performance analysis, might I suggest you look into perfmon, it's a performance monitor that comes with windows anyway.  Type perfmon at the run command (although it is in a menu somewhere).  You can add CPU usage to monitor, or actually break it down on a thread-by-thread basis.  But more importantly for your needs, you can just set it to record, and get on with your testing!
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 11955153
:o\ Sorry. :o)  & thanks..

[r.D]
0
 

Expert Comment

by:Vseznayka
ID: 12653791
DrWarezz,

How about using two monitors?  If your video card supports two monitors, and nowdays most do, you can use one monitor to run your game fullscreen, while on another you can run Task Manager or any other measuring tool of your choice.  Just make sure  to setup your second monitor as "desktop extension".  

-Vseznayka
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 104
Java syntax, or is it Selenium 6 61
Strange router problem - can't access hotmail.com 14 108
Which is best Image Resizing Web service 11 41
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question