@@ -2040,34 +2040,38 @@ namespace eval jobs {
20402040 dict with cpuvalues {
20412041 lappend usrseries ${usr%}
20422042 lappend sysseries ${sys%}
2043- # to include interrupt requests uncomment below
2044- # lappend irqseries ${irq%}
2043+ lappend irqseries ${irq%}
20452044 }}
20462045 # Delete the first and trailing values if usr utilisation is 0, so we start from the first measurement and only chart when running
20472046 if { [ lindex $usrseries 0 ] eq 0.0 } {
20482047 set usrseries [ lreplace $usrseries 0 0 ]
20492048 set sysseries [ lreplace $sysseries 0 0 ]
2050- # to include interrupt requests uncomment below
2051- # set irqseries [ lreplace $irqseries 0 0 ]
2049+ set irqseries [ lreplace $irqseries 0 0 ]
20522050 set xaxisvals [ lreplace $xaxisvals 0 0 ]
20532051 }
20542052 while { [ lindex $usrseries end ] eq 0.0 } {
20552053 set usrseries [ lreplace $usrseries end end ]
20562054 set sysseries [ lreplace $sysseries end end ]
2057- # to include interrupt requests uncomment below
2058- # set irqseries [ lreplace $irqseries end end ]
2055+ set irqseries [ lreplace $irqseries end end ]
20592056 set xaxisvals [ lreplace $xaxisvals end end ]
20602057 }
20612058 if { ![ info exists dbdescription ] } { set dbdescription " Generic CPU" }
20622059 set line [ticklecharts::chart new]
20632060 set ::ticklecharts::htmlstdout " True" ;
2064- $line SetOptions -title [ subst {text " $dbdescription $jobid " } ] -tooltip {show " True" } -legend {bottom " 5%" left " 40%" }
2061+ set irqSeriesName " irq%"
2062+ # Set 'showIrqSeries' to True to show the IRQ series in the chart (default is 'False').
2063+ set showIrqSeries " False"
2064+ # Use 'irqJS' to toggle the visibility of the IRQ series in the chart.
2065+ set irqJS [ticklecharts::jsfunc new [subst {{'$irqSeriesName ': [string tolower $showIrqSeries ]}}]]
2066+ $line SetOptions -title [ subst {text " $dbdescription $jobid " } ] \
2067+ -tooltip {show " True" } \
2068+ -legend [list bottom " 5%" left " 40%" selected $irqJS ]
20652069 $line Xaxis -data [list $xaxisvals ] -axisLabel [list show " True" ]
20662070 $line Yaxis -name " $axisname " -position " left" -axisLabel {formatter {" {value}" }}
20672071 $line Add " lineSeries" -name " usr%" -data [ list $usrseries ] -itemStyle [ subst {color green opacity 0.90} ]
20682072 $line Add " lineSeries" -name " sys%" -data [ list $sysseries ] -itemStyle [ subst {color red opacity 0.90} ]
2069- # to include interrupt requests uncomment below
2070- # $line Add "lineSeries" -name "irq%" -data [ list $irqseries ] -itemStyle [ subst {color blue opacity 0.90} ]
2073+ # 'irqseries' is included but hidden by default with 'showIrqSeries' variable set.
2074+ $line Add " lineSeries" -name $irqSeriesName -data [ list $irqseries ] -itemStyle [ subst {color blue opacity 0.90} ]
20712075 set html [ $line toHTML -title " $jobid " ]
20722076 # If we query the metrics chart while the job is running it will not be generated again
20732077 # meaning the output will be truncated
0 commit comments