Class ::rrd::Plugin (public)
::nx::Class ::rrd::Plugin
Defined in packages/rrd-tool/tcl/rrd-procs.tcl
- Testcases:
- No testcase defined.
Source code: :property vars :property name :property {rrdRoot /var/lib/munin/localdomain/localhost.localdomain} :property rrdPath :property {type DERIVE} :property {durations { "5 min" "2 days" "30 min" "9 days" "2 hours" "45 days" "1 day" "450 days" }} :public object method update {plugins} { foreach p $plugins { if {[info commands $p] eq ""} { ns_log warning "::rrd::Plugin: $p is not a command, ignore update" continue } $p update } } :method init {} { next if {![info exists :name]} { set :name [namespace tail [self]]} set :rrdPath ${:rrdRoot}_${:name} set :baseResolution [clock scan [lindex ${:durations} 0] -timezone :UTC -base 0] foreach varName ${:vars} { ::rrd::DataSource create [self]::$varName -baseResolution ${:baseResolution} -type ${:type} } } :public method baseResolution {} { return ${:baseResolution} } :public method datasource {varName} { if {[info commands [self]::$varName] ne ""} { return [self]::$varName } else { error "no data source $varName exists for plugin ${:name}" } } :public method datasources {} { return [:info children -type ::rrd::DataSource] } :public method updateDataSource {varName value} { [self]::$varName update $value }XQL Not present: Generic, PostgreSQL, Oracle