Feature #280

Feature #357: Enduro/X 7.0 master task

"top" like real time update screen for services and queues

Added by Madars about 6 years ago. Updated over 5 years ago.

Status:NewStart date:02/05/2018
Priority:Normal (Code 4)Due date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

we could have

xadmin tops (psc top)
xadmin topq (pq top)

We should show the binaries in top which have bigger delta change since last resource scan. Refresh every x seconds

History

#1 Updated by Madars about 6 years ago

To get screen geometry: popen (" stty size") and parse:

$ stty size
34 103

To re-draw screen use: system("clear");

#2 Updated by Madars about 6 years ago

tops -s (default) by succeed count, secondary order succeed total, third order by srvid, forth order by service name
tops -f order by fail count increment, secondary order fail total, third order by srvid, forth order by service name
tops -b order by busy services, secondary order succeed total, third order by srvid, forth order by service name
tops -m -> sort by max rsp time
tops -l -> sort by last rsp time

Also we want a sorting by delta ( Success: S - Descending, s - ascending, Fail: F - descending, f - ascending)

#3 Updated by Madars about 6 years ago

for tops, if space allows add delta column

Nd Service Name Routine Name Prog Name SRVID #SUCC #FAIL MAX      LAST     STAT  DELTA
-- ------------ ------------ --------- ----- ----- ----- -------- -------- ----- -----------
1  @TM-1-1-310  TPTMSRV      tmsrv     310   0     0     0ms      0ms      AVAIL (removed)
1  @TM-1-1      TPTMSRV      tmsrv     310   0     0     0ms      0ms      AVAIL (added)
1  @TPRECOVER   TPRECOVER    tprecover 1     0     0     0ms      0ms      AVAIL S5,1.5,F1,0.5
1  @TPEVPOST    TPEVPOST     tpevsrv   300   0     0     0ms      0ms      AVAIL S1,1,F2,2.9
1  @TM-1        TPTMSRV      tmsrv     310   0     0     0ms      0ms      AVAIL S2,0.1,F1,0.25

If particular row was present at previous scan, and missing at new scan or vice versa, then add those lines at the top. at that scan interval. So we shall show also Fails/sec, Succeed/sec

#4 Updated by Madars about 6 years ago

xadmin topp -> ppm monitor, watch over RSP column

#5 Updated by Madars about 6 years ago

should go to 5.3

#6 Updated by Madars about 6 years ago

So basically:

start:
- we have two hashes, current result and previous, each hash key is build accordingly, for example serverid/service_name
- create additional structure to hold the compare data
- scan current all keys to old, detect whats new here, mark records as new if needed
- scan old, detect keys missing in current, add records, mark as removed
- transfer current to linear array
- sort linear array with qsort, set the corresponding sort function
- clear screen
- get terminal x,y
- print the results (x lines, y chars)
- sleep 2 sec (from config t XXXX to override time)
free the linear array
- free previous hash
- save current hash ptr as old
- goto "start"
- at the end free up all hashes.
- allow to switch modes by background key scan (new thread, which changes the sort mode, i.e. s,f,b,m,l. This will store the letter in some global var
- if pressed "q", we should return back to terminal, background thread is killed.

We need following callback to make it "top" generic:

1. top_results_get (call corresponding services). Maybe we can re-use existing command callbacks?
2. top_results_transfer copy to hash list
3. top_get_array
4. top_sort_callback
5. top_print_hdr with snprintf(according to terminal size &buffer size)
6. top_print_data_line with snprintf (according to terminal size &buffer size)
7. top_free_hash

By pressing keys 1...9 that will set refresh seconds

#7 Updated by Madars almost 6 years ago

version 5.4, implement for tops, topp, topc, topq

#8 Updated by Madars almost 6 years ago

  • Parent task set to #328

#9 Updated by Madars over 5 years ago

  • Parent task changed from #328 to #357

Also available in: Atom PDF