nsmcp::UnifiedAccessAnalytics method init (protected)

 <instance of nsmcp::UnifiedAccessAnalytics[i]> init

Defined in /usr/local/ns/tcl/nsmcp/log-traffic-unified.tcl

Testcases:
No testcase defined.
Source code:
if {${:ingestBytes}<131072 || ${:ingestMilliseconds}<10 || ${:ingestMilliseconds}>10000} {error "invalid continuous ingestion limits"}
set :path [file normalize ${:path}]
set :mutex [ns_mutex create "nsmcp:unified-access:[ns_info server]"]
set :retentionSeconds [dict get ${:settings} retention]
set :legacyDatabase ${:database}
set :database [::nsmcp::UnifiedAccessDatabase create [self]::database -settings ${:settings} -maxBytes [dict get ${:settings} maxBytes]]
set init [accessRecordStoreOpen ${:settings}]
if {![$init available]} {$init close; error "access store initialization pool unavailable"}
set db [$init session]
try {
    set source [$db scalar {SELECT coalesce((SELECT value FROM nsmcp_records.state WHERE key='sourcePath'),'')}]
    if {$source ne {} && $source ne ${:path}} {error "access store belongs to another configured source; use a separate record directory"}
    set path ${:path}
    $db execute {INSERT OR IGNORE INTO nsmcp_records.state(key,value) VALUES('sourcePath',$path)}
} finally {$init close}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: