ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine


20. 2
   Sampling System Cores Statistics

 

Monitoring interrupts per CPU core on UNIX systems

ELEMENTS-GROUPING-CLASS: SYSSTATGROUP

GG-function: ggsysstat()

Sample workspace: SYSSTATS

Glob the system interrupts 10 times with 250 millis delay

      sta250 = ggsysstat(grp1,ViennaStat2,delay,250); ?10,0 sta250       where sta250 is a set variable

print the differential group variable sta250

      @   sta250

Set ks to desirable interrupts

      ks   user nice system idle iowait irq softirq mtime aelm

Show sampled changes in all instances of sta250

      ,gD`ks~   @sta250

Show sampled changes in sta250 using playchanges command

      playchanges   sta250

Set intermittent on historical differential data

      intermittentarc   1

Show intermittent changes in sta250

      playchanges   sta250

Show similarity between the sampled changes in sta250

      playsim   sta250

Show changes between all instances of sta250

      playop   fU,`ks~   sta250

Set intermittent to continuous

      intermittentcontinuous   1

Show changes intermittently and continuously in sta250

      playop   fU,`ks~   sta250

how to monitor changes in system interrupts, monitor changes of interrupts per CPU core

●  Sampling System Cores Statistics

The following ASPL script, procstat.aspl, samples the system statistics on a UNIX system from /proc/stat. The script takes two numbers as arguments: the first is the number of iterations, and the second is the delay in milliseconds.

 -LIS- Listing. 20.2.1   [LISTING procstat.aspl][ASPL Script procstat.aspl]
(raw text)
1.     #!/usr/bin/env  aspl 
2.     #ENVARG= -wsname TRANSIENT -groupingclass SYSSTATGROUP
3.     
4.     ;;***********************************************************************
5.     ;;   procstat.aspl
6.     ;;   
7.     ;;   Copyright © 2021-2025 Bassem W. Jamaleddine
8.     ;;   All rights reserved.
9.     ;;   
10.    ;;***********************************************************************
11.    
12.    endScriptIfShellArgsLessThan 2
13.    
14.    printblock SAMPLING SYSTEM STATISTICS $1 TIMES WITH DELAY OF $2 MILLISECONDS
15.    stas = ggsysstat(grp1,LabelABC,delay,$2)
16.    ?$1,0  stas
17.    printblock SAMPLED DATA IN DIFFERENTIAL VARIABLE stas
18.    @  stas
19.    printblock SET ks TO DESIRED STATISTIC IDENTIFIERS
20.    ks user nice system idle iowait irq softirq aelm
21.    intermittentarc 1
22.    printblock PLAY INTERMITTENT CHANGES IN STATISTICS
23.    playchanges  stas
24.    printblock SHOW DISSIMILARITY BETWEEN UNIX PROCESSES
25.    playsim  stas
26.    printblock GROUP DIFFERENTIAL OPERATOR g@ ON UNIX PROCESSES
27.    intermittentcontinuous 1
28.    g@,`ks~  stas
29.    
30.    endscript
31.    
32.    __END__
33.    
34.    $00 must be followed by two numbers specifying: iteration millis
35.    
36.       Sample system statistics looping 15 times with 250 milliseconds delay
37.          $00 15  250
38.       Sample system statistics looping 10 times with 3 seconds delay
39.          $00 15  3000
40.    

SetSphere(C) 2025 Bassem Jamaleddine


The following display shows the output of the script when run on the Linux system:

viewme

 -TC- Display. 20.2.1   [Sampling System Cores Statistics: procstat.aspl]
Sampling System Cores Statistics: procstat.aspl

 

Sampling System Cores Statistics

Aside from the script, in this example we show various commands to display the sampled system statistics. We load the sample workspace SYSSATS whose grouping class is SYSSTATGROUP, and issue various set operations to play the data on the differential group variable stats. Of course, you can start ASPL by creating a new workspace whose grouping class is SYSSTATGROUP. For example, the following start ASPL with the workspace JUNKSTATS:

aspl -wsname JUNKSTATS -groupingclass SYSSTATGROUP

 

Sampling System Cores Statistics

aspl SYSSTATS
    (start ASPL loading the sample workspace SYSSTATS)

①  aspl> stats = ggsysstat(grp1,ViennaStats,delay,1000); ?7,0 stats
    glob the system statistics 7 times with delay 1000 milliseconds

②  aspl> dm 5
    set display mode to 5

③  aspl> @ stats
    print the differential group variable stats

④  aspl> playchanges stats

⑤  aspl> intermittentarc 1

⑥  aspl> playchanges stats

⑦  aspl> playsim stats

⑧  aspl> ks user nice system iowait aelm

⑨  aspl> playchanges stats

⑩  aspl> ks user nice system idle iowait irq softirq aelm

⑪  aspl> playchanges stats

⑫  aspl> differentialallarc 1

⑬  aspl> g@,`ks~ stats

⑭  aspl> playop gU,`ks= stats

⑮  aspl> ks iowait aelm

⑯  aspl> playop gU,`ks~ stats

⑰  aspl> playop gU,`ks= stats

⑱  aspl> playop gU, stats

viewme

 -TC- Display. 20.2.2   [Sampling System Cores Statistics]
Sampling System Cores Statistics