rrd::Graph method render (public)
<instance of rrd::Graph> render
Defined in packages/rrd-tool/tcl/rrd-procs.tcl
- Testcases:
- No testcase defined.
Source code: set defs [list ${:filename}] foreach v [[current class] info variables] { set varName [:info variable name $v] # # the following four varnames are NOT from rrd, so don't pass # these as is to rrd. # if {$varName in {elements filename name period}} { continue } # # These are configuration variables from rrd # if {[info exists :$varName]} { switch -glob -- [lindex [:info variable parameter $v] 0] { *:boolean { if {[set :$varName]} {lappend defs --$varName} } *:0..n { foreach e [set :$varName] { lappend defs --$varName $e } } default { lappend defs --$varName [set :$varName]} } } } switch ${:period} { day {set scale 34560} hours {set scale 1440} minutes {set scale 60} seconds - default {set scale 1} } foreach e ${:elements} { $e configure -scale $scale } lappend defs "COMMENT: \t\t Cur\tMin\t Avg\t Max\\l" foreach e ${:elements} { lappend defs {*}[$e render] } # get the lastupdate from the last element lassign [[$e cget -datasource] lastupdate] ds secs value regsub -all {:} [clock format [string trimright $secs :]] {\:} ts lappend defs "COMMENT:Last update\\: $ts\\r" #append ::_ "<p>GRAPH<br>[join $defs <br>\n]<br>\n" return $defsXQL Not present: Generic, PostgreSQL, Oracle