Class ::ns::ns_stats (public)
::nx::Class ::ns::ns_stats![[i]](/resources/acs-subsite/ZoomIn16.gif)
Defined in
- Testcases:
-
No testcase defined.
Source code:
::nsf::object::alloc ::nx::Class ::ns::ns_stats {}
::ns::ns_stats public method {history persist} {} {
set config [nsv_get ns_stats history]
if {$config eq "" || ![dict get $config enabled]} {
return
}
:object mixins set [dict get $config mixins]
:history save
}
::ns::ns_stats protected method startup {} {
set section ns/stats
set server [ns_config $section server [lindex [ns_info servers] 0]]
if {$server ne [ns_info server]} {
return
}
set sampling [ns_config -bool $section sampling false]
set pool [ns_config $section historyPool {}]
if {!$sampling && $pool eq ""} {
return
}
set interval [ns_baseunit -time [ns_config $section samplingInterval 10s]]
if {$sampling && ($interval<1 || $interval>3600)} {
error "ns/stats samplingInterval must be 1..3600 seconds"
}
if {$pool ne ""} {
:history configure -pool $pool -retention [ns_config $section historyRetention 24h] -maxBytes [ns_config $section historyMaxBytes 64MiB]
}
if {$sampling} {
:sampling start -interval $interval
}
}
::nsf::relation::set ::ns::ns_stats superclass ::ns::stats::Sampler
::nx::slotObj -container slot ::ns::ns_stats
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]