nsmcp::AccessDiagnosticTool method seekSample (protected)
<instance of nsmcp::AccessDiagnosticTool> seekSample channel \ position size samplesVar bytesVar
Defined in /usr/local/ns/tcl/nsmcp/traffic-tools.tcl
- Parameters:
- channel (required)
- position (required)
- size (required)
- samplesVar (required)
- bytesVar (required)
- Testcases:
- No testcase defined.
Source code: upvar 1 $samplesVar samples $bytesVar probeBytes seek $channel $position set block [read $channel [expr {min(65536,$size-$position)}]] incr probeBytes [string length $block] set offset $position if {$position>0} { set cut [string first \n $block] if {$cut<0} {error "No complete timestamped line at seek probe"} incr offset [expr {$cut+1}] set block [string range $block [expr {$cut+1}] end] } foreach line [lrange [split $block \n] 0 end-1] { set end [expr {$offset+[string length $line]+1}] set at [::nsmcp::accessRecordParser completionTime [encoding convertfrom utf-8 $line]] if {$at ne ""} { dict set samples $offset $at set previous -1 foreach key [lsort -integer [dict keys $samples]] { set time [dict get $samples $key] if {$time<$previous} {error "Completion timestamps are not ordered at seek probes"} set previous $time } return [list $offset $end $at] } set offset $end } error "No timestamp at seek probe"XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)