Skip to content

Instantly share code, notes, and snippets.

@jamerfort
Created April 6, 2012 18:46
Show Gist options
  • Save jamerfort/2322016 to your computer and use it in GitHub Desktop.
Save jamerfort/2322016 to your computer and use it in GitHub Desktop.
Get a count of messages in the Cloverleaf recover database.
#!/usr/bin/env hcitcl
msiAttach
# get a list of threads
set threads [msiTocEntry]
set num_threads [llength $threads]
set total_pending 0
# loop through each thread
for {set i 0} {$i < $num_threads} {incr i} {
set thread [lindex $threads $i]
set pending 0
catch {
# get this thread's stats
set stats [msiGetStatSample $i]
set pending [keylget stats OBDATAQD]
foreach inter_thread_stat [keylget stats INTERTHREAD] {
# get the Post XLate Queued value
set pxqd_value [keylget inter_thread_stat POSTXLTQD]
if { $pxqd_value > 0 } {
incr pending $pxqd_value
}
}
}
if { $pending > 0 } {
incr total_pending $pending
}
}
puts $total_pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment