PureMonitor for OS X

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

PureMonitor for OS X

Post 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
Last edited by J. Baker on Tue Oct 21, 2014 10:51 am, edited 38 times in total.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post by J. Baker »

Just updated the app. It should now auto-close when you close your app. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: PureMonitor for OS X

Post 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)
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureMonitor for OS X

Post by Fred »

Great idea !
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureMonitor for OS X

Post by wilbert »

You could consider an input field for a threshold value and give some kind of alarm when the threshold is crossed.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureMonitor for OS X

Post 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.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
infratec
Always Here
Always Here
Posts: 6810
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureMonitor for OS X

Post 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
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureMonitor for OS X

Post 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.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: PureMonitor for OS X

Post 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.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
Post Reply