topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 12:01 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Qslice... app to show cpu usage by process in a visual format, including threads  (Read 13948 times)

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
An interesting app is Qslice.  This is a program that visually graphs each process' cpu usage.  One of the cool things about it is you can double click on any process, and another window opens up showing the individual threads inside that process with the cpu usage of those threads shown in a similar visual format.  ProcessExplorer (SysInternals) can do this but not in a visual way-- only textually).  Sadly, Qslice has never been fully developed and has a lot of shortcomings.  Columns cant be resized, colors, fonts etc cant be changed.  And there is no scrollbar so if you have over a couple dozen processes running, chances are you wont be able to get to them.  Also, the cpu usage is shown in a vertically stacked format, with each process getting its own 0-100% bar, which is actually somewhat inefficient. 

A similar program called BVSlice was also made, but had some problems and still was locked to the vertical interface which becomes tedious with many processes running.  And the website seems to be gone, developer has abandoned this project long ago. 

A long time ago I remember working on an SGI workstation running IRIX 6.x and it had this really cool app (forget what it was called) that displayed cpu usage in a horizontal bar similar to this:

The bar was resizable both horizontally and vertically, and would automatically scale to whatever size you stretched it to.  So in the above sample image, the outer rectangle represents 100% of the cpu, and each different colored bar is an individual process.  The bars are stacked up against each other to make up the total cpu usage at the current moment in time.  So in that sample above, cpu usage is about 40% total, with explorer.exe using about 11%, javaw.exe about 8%, firefox maybe 16% and csrss.exe 5%.

It would be really great if something like this existed for windows... does anyone know of one?  If not, perhaps one of the developers on here would consider making this as a Coding Snack or a Donationware.


Some more ideas:
1) ability to customize the color set used
2) change whether process names are shown below the bar or not
3) change fonts/sizes of process names
4) omit any app <n% (similar to how mouser has done it in ProcessTamer)
5) customizable refresh interval (500ms, 1s, 5s etc)

comments?

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,260
    • View Profile
    • Donate to Member
I would really like such an app if I could average the displayed values over x seconds. Same for RAM usage of processes!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
ram might be more interesting to look at - my experience is that cpu useage is very often just one or 2 programs using the cpu, and everything else < 1%, but as brotherS if you averaged it over some period it might be interesting.

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
yes I agree, well in my post, #5 specifically addresses that need.. the customizable refresh interval.  If you set it for like 30 seconds, or 5 minutes even, you would achieve what you are talking about I think.  And yes I like the idea of adding RAM usage to the feature set as well.  Is anyone up to this challenge?

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
I'd like to do it, but i think i could only use the data in Process manager, because ahk doesn't have any functions to access those kind of features. The implications would be the same that Skrommel's process guard has, you wouldn't have access to process manager from ctrl-alt-del, and you'd allways have another icon in the tray bar. For me, those are major disadvantages, i think it should be used another approach.
(maybe Fsbl? ;) )

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
this one probably calls for some down and dirty C# or .NET programming.  These super high level languages like FSBL, AHK, etc are just too far removed from the type of information needed to efficiently create such a tool.  This is of course in my highly un-informed opinion, as I am not a true programmer myself.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
These super high level languages like FSBL, AHK, etc are just too far removed from the type of information needed to efficiently create such a tool. 
Don't defy FBSL... I think that gerome will prove you wrong ;)

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
I am not defying FBSL, in fact I know very little about it.  I glanced briefly at the "home page" of it which is just a forum and did not have the time to dig very deeply into it.  From what little I know, it seems to have a fairly small following and thus I doubt if anyone here, aside from Gerome himself of course, would be able to code this app using FBSL.  It also seems to be a high-level language similar to VBscript, which leads me to believe it might be slower than compiled C code as well.  I would be more than happy to be proven wrong of course!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
i could probably add this to process tamer without much trouble.

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Ohhh dont tease me mouser!!!  ;D ;D

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
i could probably add this to process tamer without much trouble.
:Thmbsup: :Thmbsup: nice!

LuckMan212

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
sorry to drift off topic, but I just noticed the Valentine's day Cody bird!  cute!! :-*

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Hello,

I am not defying FBSL, in fact I know very little about it.  I glanced briefly at the "home page" of it which is just a forum and did not have the time to dig very deeply into it.  From what little I know, it seems to have a fairly small following and thus I doubt if anyone here, aside from Gerome himself of course, would be able to code this app using FBSL.  It also seems to be a high-level language similar to VBscript, which leads me to believe it might be slower than compiled C code as well.  I would be more than happy to be proven wrong of course!

Hehe...
No defy please :)
FBSL is 5 years old, and is capable of manipulating :
-1- 5 variables types : 32bits integers, 32bits floats, 64bits doubles, strings and pointers.
-2- has several native layers : COM, API, CLIPBOARD, STRING, MATHS, REGEX, COLLECTIONS, MMF, LZO COMPRESSION, SOCKETS, THREADS and CONSOLE.
-3- is able to 'self compile' into an EXEcutable that is 100% autonomous ( no extra runtime to run the code)
-4- is able to 'self decompile' an EXE into an .fbs script file/buffer
-5- has a 3rd part Stdcall flat model DLL to make C, VB, Delphi developpers using this dll to use some FBSL code through their applications.
-6- a 500 pages CHM help file that comes with grammar documentation + samples, several tutorials, macro files, declare files, constants files and more!

Compared to VBScript & JScript, FBSL is 20x faster than those scripting languages.
Compared to VBScript & JScript, FBSL is capable of beeing compiled as autonaumous EXEcutables.
Compared to VBScript & JScript, FBSL is able to call API functions from ANY kinda DLL ( C,C++,Delphi,.NET,... )
Compared to VBScript & JScript, FBSL is capable of executing VBS & JS :)
Compared to VBScript & JScript, FBSL is capable of GUI.
Compared to VBScript & JScript, FBSL is capable of Callbacks.
Compared to VBScript & JScript, FBSL is capable of natively Compressing Data.
Compared to C compiled code, FBSL is about 10% slower.
But FBSL remains a script language, onto its category, FBSL is placed amongst the fastest scripting languages :)

Yes my site is focused onto Fbsl forum, BUT don't forget that FBSL is a language, so i can guess a forum is more oriented to my language than to our personal lifes :)

At last, i'm not here to decorate, not making vaporware/deadware like tons of'em one can easily find over the internet... and amongst'em tons of started projects...

BTW, if you need help, i ust can invite you to my Forum, it's free and open minded ;)

Have a good day!

PS : to reply to the question, YES, FBSL is capable of treating the kinda GUI software you want to have...
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)
« Last Edit: February 11, 2006, 06:20 AM by Gerome »

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Almost missed this thread.
Returning running processes with FBSL is quite simple, just use the CreateToolhelp32Snapshot api.

Here's some quick down and dirty script to get you started.  :)

#option explicit
'$apptype console
#dlldeclare kernel32("CreateToolhelp32Snapshot","Process32First","Process32Next"_
"CloseHandle","GetCurrentProcessId")

dim %hList,$TabStop,$buff,$buffer
dim $PROCESSENTRY32,%hSnapshot,%success

alloc(PROCESSENTRY32,MAX_PATH + 36)
SetMem(PROCESSENTRY32,MAX_PATH + 36,0)

alloc(TabStop,12)
alloc(buff,MAX_PATH)
alloc(buffer,MAX_PATH)
SetMem(TabStop,100,0)
FBSL_SETTEXT(me,"Running Processes")
hList = Fbsl_control("ListBox",me,NULL,NULL,20,20,360,250,_
WS_CHILD + WS_VISIBLE + WS_HSCROLL + WS_VSCROLL + LBS_SORT + LBS_USETABSTOPS,WS_EX_STATICEDGE)
SendMessage(hList,LB_SETTABSTOPS,0,0)
SendMessage(hList,LB_SETTABSTOPS,1,TabStop)
SendMessage(hList,LB_SETTABSTOPS,2,TabStop)
Resize(me,0,0,400,300)
center(me)
show( me )
GetProccess()
begin events

  select case cbmsg


    case wm_close
        exitprogram(0)
  End Select
end events

sub GetProccess()

const TH32CS_SNAPPROCESS = &H2

hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0)

If hSnapShot = -1 Then Exit Sub



success = Process32First(hSnapShot,PROCESSENTRY32)

If success = 1 then

        Do

buff = GetMem(PROCESSENTRY32,36,$MAX_PATH)
realloc(buff,strlen(buff))

buff =  buff & Tab &  GetMem(PROCESSENTRY32,20,4) & Tab & "Thread Count"

            SendMessage(hList,LB_ADDSTRING,0,buff)
        Loop while Process32Next(hSnapshot,PROCESSENTRY32)
           
    End If

    CloseHandle(hSnapShot)


End sub
This will return a list of running processes and their thread count.
When I get more time I'll see what I can do about your request.

« Last Edit: February 11, 2006, 08:32 PM by Cpilot »

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Hi cpilot,

Here's the result of your script onto my win2k :


Just for information, for those who don't have Fbsl instlled yet, you can test those scripts by simply copying/pasting them into my online Fbsl compiler, it'll output an executable of the given script :)
See http://gedd123.free.fr/studio for more informations :)

Enjoy ;)

PS : Hey LuckyMan212! Just take this as an invitation to know more about Fbsl...
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)
« Last Edit: February 11, 2006, 04:24 PM by Gerome »

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
FWIW,
The CreateToolhelp32Snapshot api can return lots of information about running processes, threads and modules operating on your system.

CreateToolhelp32Snapshot

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Hi,

FWIW,
The CreateToolhelp32Snapshot api can return lots of information about running processes, threads and modules operating on your system.

CreateToolhelp32Snapshot

May i precise this URL :
http://msdn.microsof...hreadentry32_str.asp
and look at the 'tpBasePri' flag where are exposed the differents states of the thread... :)
I didn't remember who said that it was impossible to grab/exploit those informations with Fbsl... ^^
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)