nsmcp::usageAdd (private)

 nsmcp::usageAdd statsVar record

Defined in /usr/local/ns/tcl/nsmcp/examples/nsmcp-openacs-api-docs.tcl

Accumulate one model-usage record into the supplied usage statistics variable.

Parameters:
statsVar (required)
record (required)

Partial Call Graph (max 5 caller/called nodes):

Testcases:
No testcase defined.
Source code:
    upvar 1 $statsVar stats
    dict incr stats questions
    set state [dict get $record state]
    dict incr stats $state
    set tokens [dict get $record tokens]
    foreach key {inputTokens outputTokens totalTokens cachedInputTokens} {
        if {[dict exists $tokens $key] && $state ne "unavailable"} {
            set bucket [dict get $stats ${state}Tokens]
            dict incr bucket $key [dict get $tokens $key]
            dict set stats ${state}Tokens $bucket
        } else {
            set missing [dict get $stats missingCounters]
            dict incr missing $key
            dict set stats missingCounters $missing
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: