<commit_before>block = "System"

[commands]
sys.ps.states = "ps -axo state=\
 | awk  'BEGIN {FS=null} {print $1}'\
 | sort\
 | uniq -c\
 | awk '\
  /D/ {print \"S_ps_uint\", $1}\
  /I/ {print \"S_ps_idle\", $1}\
  /L/ {print \"S_ps_lock\", $1}\
  /R/ {print \"S_ps_rnbl\", $1}\
  /S/ {print \"S_ps_slpn\", $1}\
  /T/ {print \"S_ps_stpd\", $1}\
  /W/ {print \"S_ps_intr\", $1}\
  /Z/ {print \"S_ps_zmbe\", $1}\
 '"
; use double quotes since backticks must be parsed
sys.sysctl.stats = "sysctl\
 kern.boottime\
 kern.clockrate\
 kern.cp_time\
 hw.ncpu\
 vfs.bufspace\
 vm.stats.vm.v_active_count\
 vm.stats.vm.v_cache_count\
 vm.stats.vm.v_free_count\
 vm.stats.vm.v_inactive_count\
 vm.stats.vm.v_page_count\
 vm.stats.vm.v_page_size\
 vm.stats.vm.v_swappgsin\
 vm.stats.vm.v_swappgsout\
 vm.stats.vm.v_wire_count\
 | awk \"\
  /hw\\.ncpu/ {print \\\"S_hw_ncpu\\\", \\$2}\
  /kern\\.boottime/ {print \\\"S_uptime_days\\\", (`date +%s` - \\$5) / 86400}\
  /kern\\.clockrate/ {print \\\"S_k_clockrate\\\", int(substr(\\$0,index(\\$0,\\\"stathz\\\")+9))}\
  /kern\\.cp_time/ {\
    print \\\"S_k_cp_user\\\", \\$2;\
    print \\\"S_k_cp_nice\\\", \\$3;\
    print \\\"S_k_cp_sys\\\", \\$4;\
    print \\\"S_k_cp_intr\\\", \\$5;\
    print \\\"S_k_cp_idle\\\", \\$6;\
  }\
  /vfs\\.bufspace/ {print \\\"S_vfs_bufspace\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_active_count/ {print \\\"S_v_active_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_cache_count/ {print \\\"S_v_cache_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_free_count/ {print \\\"S_v_free_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_inactive_count/ {print \\\"S_v_inactive_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_page_count/ {print \\\"S_v_page_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_page_size/ {print \\\"S_v_page_size\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_swappgsin/ {print \\\"S_v_swappgsin\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_swappgsout/ {print \\\"S_v_swappgsout\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_wire_count/ {print \\\"S_v_wire_count\\\", \\$2}\
 \""

sys.who = "who\
 | awk '\
  BEGIN {tty=0; pty=0; pts=0; other=0;}\
  {if(match($2, /tty/))tty++; else if(match($2, /pty/))pty++; else if(match($2, /pts/))pts++; else other++;}\
  END {\
    print \"S_who_tty\", tty;\
    print \"S_who_pty\", pty;\
    print \"S_who_pts\", pts;\
    print \"S_who_oth\", other;\
  }'"

[system_cpu]
class = "AreaChart"
title = "System CPU states"
options[vAxis.title] = "states / second"
options[isStacked] = true
S_k_cp_user[title] = "user"
S_k_cp_user[type] = rate
S_k_cp_user[eval] = "S_k_cp_user/S_k_clockrate*100"
S_k_cp_nice[title] = "nice"
S_k_cp_nice[type] = rate
S_k_cp_nice[eval] = "S_k_cp_nice/S_k_clockrate*100"
S_k_cp_sys[title] = "system"
S_k_cp_sys[type] = rate
S_k_cp_sys[eval] = "S_k_cp_sys/S_k_clockrate*100"
S_k_cp_intr[title] = "interrupt"
S_k_cp_intr[type] = rate
S_k_cp_intr[eval] = "S_k_cp_intr/S_k_clockrate*100"
S_k_cp_idle[title] = "idle"
S_k_cp_idle[type] = rate
S_k_cp_idle[eval] = "S_k_cp_idle/S_k_clockrate*100"

[system_memory]
class = "ComboChart"
title = "System memory"
base = 1024
options[vAxis.title] = "bytes"
options[isStacked] = true
options[seriesType] = "area"
S_v_page_size[title] = "mem page size"
S_v_page_size[type] = value
S_v_page_size[hidden] = true
S_v_active_count[title] = "active"
S_v_active_count[type] = value
S_v_active_count[eval] = "S_v_active_count*S_v_page_size"<commit_msg>fix: in system.ini use clockrate to weight cpu states<commit_after>block = "System"

[commands]
sys.ps.states = "ps -axo state=\
 | awk  'BEGIN {FS=null} {print $1}'\
 | sort\
 | uniq -c\
 | awk '\
  /D/ {print \"S_ps_uint\", $1}\
  /I/ {print \"S_ps_idle\", $1}\
  /L/ {print \"S_ps_lock\", $1}\
  /R/ {print \"S_ps_rnbl\", $1}\
  /S/ {print \"S_ps_slpn\", $1}\
  /T/ {print \"S_ps_stpd\", $1}\
  /W/ {print \"S_ps_intr\", $1}\
  /Z/ {print \"S_ps_zmbe\", $1}\
 '"
; use double quotes since backticks must be parsed
sys.sysctl.stats = "sysctl\
 kern.boottime\
 kern.clockrate\
 kern.cp_time\
 hw.ncpu\
 vfs.bufspace\
 vm.stats.vm.v_active_count\
 vm.stats.vm.v_cache_count\
 vm.stats.vm.v_free_count\
 vm.stats.vm.v_inactive_count\
 vm.stats.vm.v_page_count\
 vm.stats.vm.v_page_size\
 vm.stats.vm.v_swappgsin\
 vm.stats.vm.v_swappgsout\
 vm.stats.vm.v_wire_count\
 | awk \"\
  /hw\\.ncpu/ {print \\\"S_hw_ncpu\\\", \\$2}\
  /kern\\.boottime/ {print \\\"S_uptime_days\\\", (`date +%s` - \\$5) / 86400}\
  /kern\\.clockrate/ {print \\\"S_k_clockrate\\\", int(substr(\\$0,index(\\$0,\\\"stathz\\\")+9))}\
  /kern\\.cp_time/ {\
    print \\\"S_k_cp_user\\\", \\$2;\
    print \\\"S_k_cp_nice\\\", \\$3;\
    print \\\"S_k_cp_sys\\\", \\$4;\
    print \\\"S_k_cp_intr\\\", \\$5;\
    print \\\"S_k_cp_idle\\\", \\$6;\
  }\
  /vfs\\.bufspace/ {print \\\"S_vfs_bufspace\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_active_count/ {print \\\"S_v_active_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_cache_count/ {print \\\"S_v_cache_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_free_count/ {print \\\"S_v_free_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_inactive_count/ {print \\\"S_v_inactive_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_page_count/ {print \\\"S_v_page_count\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_page_size/ {print \\\"S_v_page_size\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_swappgsin/ {print \\\"S_v_swappgsin\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_swappgsout/ {print \\\"S_v_swappgsout\\\", \\$2}\
  /vm\\.stats\\.vm\\.v_wire_count/ {print \\\"S_v_wire_count\\\", \\$2}\
 \""

sys.who = "who\
 | awk '\
  BEGIN {tty=0; pty=0; pts=0; other=0;}\
  {if(match($2, /tty/))tty++; else if(match($2, /pty/))pty++; else if(match($2, /pts/))pts++; else other++;}\
  END {\
    print \"S_who_tty\", tty;\
    print \"S_who_pty\", pty;\
    print \"S_who_pts\", pts;\
    print \"S_who_oth\", other;\
  }'"

[system_cpu]
class = "AreaChart"
title = "System CPU states"
options[vAxis.title] = "states / second"
options[isStacked] = true
S_k_clockrate[title] = "clockrate"
S_k_clockrate[type] = value
S_k_clockrate[hidden] = true
S_k_cp_user[title] = "user"
S_k_cp_user[type] = rate
S_k_cp_user[eval] = "S_k_cp_user/S_k_clockrate*100"
S_k_cp_nice[title] = "nice"
S_k_cp_nice[type] = rate
S_k_cp_nice[eval] = "S_k_cp_nice/S_k_clockrate*100"
S_k_cp_sys[title] = "system"
S_k_cp_sys[type] = rate
S_k_cp_sys[eval] = "S_k_cp_sys/S_k_clockrate*100"
S_k_cp_intr[title] = "interrupt"
S_k_cp_intr[type] = rate
S_k_cp_intr[eval] = "S_k_cp_intr/S_k_clockrate*100"
S_k_cp_idle[title] = "idle"
S_k_cp_idle[type] = rate
S_k_cp_idle[eval] = "S_k_cp_idle/S_k_clockrate*100"

[system_memory]
class = "ComboChart"
title = "System memory"
base = 1024
options[vAxis.title] = "bytes"
options[isStacked] = true
options[seriesType] = "area"
S_v_page_size[title] = "mem page size"
S_v_page_size[type] = value
S_v_page_size[hidden] = true
S_v_active_count[title] = "active"
S_v_active_count[type] = value
S_v_active_count[eval] = "S_v_active_count*S_v_page_size"
{'fraction_non_alphanumeric': 0.24504373177842564, 'fraction_numerical': 0.01749271137026239, 'mean_word_length': 3.009935710111046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2679288', 'n_tokens_mistral': 3298, 'n_tokens_neox': 3231, 'n_words': 503}