Author Topic: getting load status for individual commands?  (Read 2564 times)

0 Members and 1 Guest are viewing this topic.

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
getting load status for individual commands?
« 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
« Last Edit: January 16, 2013, 06:49:55 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: getting load status for individual commands?
« Reply #1 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
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: getting load status for individual commands?
« Reply #2 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
Loved this place, still the best producers of power metal, and sparked my dreams of coding.