nsmcp::AccessLogIngestor method validateWindow (public)

 <instance of nsmcp::AccessLogIngestor[i]> validateWindow options

Defined in /usr/local/ns/tcl/nsmcp/lib/access-analytics.tcl

Parameters:
options (required)

Testcases:
No testcase defined.
Source code:
foreach key [dict keys $options] {if {$key ni {from to bucketSeconds}} {error "unsupported summary option"}}
set now [clock seconds]
set options [dict merge [dict create from [expr {$now-3600}] to $now bucketSeconds 60] $options]
foreach key {from to bucketSeconds} {
    if {![string is entier -strict [dict get $options $key]]} {error "expected integer epoch times and bucketSeconds"}
}
set from [dict get $options from]; set to [dict get $options to]; set size [dict get $options bucketSeconds]
if {$from >= $to || $to-$from > 86400 || $from < 0 || $to > $now || $size < 60 || $size > 3600 || $size%60 != 0} {
    error "expected a window of at most 24 hours ending no later than now and bucketSeconds a multiple of 60 between 60 and 3600"
}
return $options
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: