Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: Snake X on January 16, 2013, 06:49:19 pm

Title: getting load status for individual commands?
Post by: Snake X on January 16, 2013, 06:49:19 pm
Alright, so I run a python bot connected to some server.

I'll just start with that first.

So, when I go into SSH and I'm seeing that my bot which shouldn't be taking up much CPU happens to be the first on the list sorted by most intensive cpu processes.

I would love to know if there's some way to be able to track or trace exactly which part of my code in my python bot is causing it to create such a high amount of load on the CPU.

Right now, my only way of knowing what's taking up most of the cpu loads is this:

http://i50.tinypic.com/23sepdu.png

Not even sure what that text means under the command part... :L
Title: Re: getting load status for individual commands?
Post by: ruler501 on January 16, 2013, 06:58:14 pm
Do you have sleeps and stuff like that so that the bot isn't constantly trying to execute code? Thats one of the main reasons it may use too much CPU. Otherwise you could put timing code into it to see what is using up the most CPU time
Title: Re: getting load status for individual commands?
Post by: Snake X on January 16, 2013, 07:04:35 pm
Do you have sleeps and stuff like that so that the bot isn't constantly trying to execute code? Thats one of the main reasons it may use too much CPU. Otherwise you could put timing code into it to see what is using up the most CPU time

haha, well i had some code that was being frequently executed.. Took that out and bam! :D