Page 1 of 2

PureMonitor for OS X

Posted: Tue Feb 05, 2013 9:12 am
by J. Baker
A little tool Wilbert and I made to monitor the cpu and memory usage of a PureBasic project.

Features
  • Monitor the cpu, threads (threads running/total threads), memory, open files and open sockets of your PureBasic project.
  • Cpu and memory threshold options.
  • Optional audio and visual warnings of threshold.
  • Save a log file of the cpu and memory usage.*
  • A "Live Log" of the cpu and memory usage.*
  • Option to kill your app if it locks up when the debugger is not on.
  • Mouse click on the monitoring text to show or hide the options.
  • PureMonitor now auto opens and closes when configured in PureBasic's tools (see below).
  • 64-bit App
*The log monitors every second for 10 seconds, then every 10 seconds for 50 seconds and finally by the minute.

Configure Tools in PureBasic
  • Open "Configure Tools..."
  • Select "New"
  • Commandline: open
  • Arguments: /Applications/PureMonitor.app --args autoclose
  • Name: PureMonitor
  • Event to trigger the tool: Editor Startup
  • Select - "Hide Tool from the Main menu"
  • Click "Ok"
Download PureMonitor v1.4.0 (Developer signed for OS X 10.6+)

Image

Image

Re: PureMonitor for OS X

Posted: Tue Feb 05, 2013 10:15 am
by J. Baker
Just updated the app. It should now auto-close when you close your app. ;)

Re: PureMonitor for OS X

Posted: Tue Feb 05, 2013 11:24 am
by jesperbrannmark
Oh thats nice.
Suggestion:
Logging!! (like if I run a program for a long time so save to a csv file every minute CPU and mem average)

Re: PureMonitor for OS X

Posted: Tue Feb 05, 2013 12:00 pm
by Fred
Great idea !

Re: PureMonitor for OS X

Posted: Tue Feb 05, 2013 1:37 pm
by J. Baker
jesperbrannmark wrote:Oh thats nice.
Suggestion:
Logging!! (like if I run a program for a long time so save to a csv file every minute CPU and mem average)
Will do. ;)

Re: PureMonitor for OS X

Posted: Tue Feb 05, 2013 10:48 pm
by J. Baker
OK, it now has an option to log the average cpu and memory usage by the minute. The file is saved as "PureMonitorLog.txt" in your "Documents" folder. Use the same download link as from above. ;)

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 12:56 am
by J. Baker
Fixed a division bug and added a MessageRequester(). If you are logging your resources and you close your app, a MessageRequester() will pop up and ask if you want to open the "PureMonitorLog.txt" file. Use the same download link as from above. ;)

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 6:50 am
by wilbert
You could consider an input field for a threshold value and give some kind of alarm when the threshold is crossed.

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 7:22 am
by J. Baker
wilbert wrote:You could consider an input field for a threshold value and give some kind of alarm when the threshold is crossed.
Are you talking about a threshold for memory?

Also, just added an update. Couple of small/minor fixes, new icon and the app is now signed for gatekeeper purposes. ;)

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 7:43 am
by wilbert
J. Baker wrote:Are you talking about a threshold for memory?
It could be but it also could be cpu usage.
You could for example decide that you don't want the cpu load to get above 25%.
If you would give some kind alarm when it crosses that (could be a sound or show the max cpu load in the application badge for a few seconds), you know what parts of your application need improvement.

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 7:54 am
by J. Baker
wilbert wrote:
J. Baker wrote:Are you talking about a threshold for memory?
It could be but it also could be cpu usage.
You could for example decide that you don't want the cpu load to get above 25%.
If you would give some kind alarm when it crosses that (could be a sound or show the max cpu load in the application badge for a few seconds), you know what parts of your application need improvement.
Yes, that does sound good. I had been thinking memory but one for the cpu would be good too.

What I was thinking about memory, is that if the memory keeps going up and up, there may be a memory leak. Then the app would give a warning. I guess I could do that for both the cpu and memory. Looks like we are thinking on the same page. :D

Now what I wasn't sure about is... What if the user walks away from their computer and it throws a warning on one of the two. Should I set a timer, that if the warning isn't responded to, it kills the app?

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 8:19 am
by infratec
Hi,

since I do a lot of stuff with 'monitoring' (SNMP),
I suggest to send an e-mail if an alarm occurs and an e-mail address is given.

For killing the app: Maybe you can add a second alarm value/level.

20% memory usage: send e-mail
25% memory usage: kill app

Bernd

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 8:32 am
by J. Baker
infratec wrote:Hi,

since I do a lot of stuff with 'monitoring' (SNMP),
I suggest to send an e-mail if an alarm occurs and an e-mail address is given.

For killing the app: Maybe you can add a second alarm value/level.

20% memory usage: send e-mail
25% memory usage: kill app

Bernd
Nice ideas but I hope someone wouldn't walk away too far when testing there app out. By that, I mean having to send an email. I don't know though, I could be wrong.

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 10:11 am
by wilbert
J. Baker wrote:What if the user walks away from their computer and it throws a warning on one of the two. Should I set a timer, that if the warning isn't responded to, it kills the app?
I would only kill an app automatically if the available free memory (can also be checked) gets too low.

Re: PureMonitor for OS X

Posted: Wed Feb 06, 2013 10:24 am
by J. Baker
wilbert wrote:
J. Baker wrote:What if the user walks away from their computer and it throws a warning on one of the two. Should I set a timer, that if the warning isn't responded to, it kills the app?
I would only kill an app automatically if the available free memory (can also be checked) gets too low.
Yes, that would be best. I will definitely look into it thoroughly before making any final decision on that option.