Changeset 302


Ignore:
Timestamp:
09/28/03 13:54:34 (8 years ago)
Author:
jamesoff
Message:

added hourly-on-the-half-our self-diagnostics for timers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/diagnostics.tcl

    r183 r302  
    7070} 
    7171 
     72# 
     73# make sure we only have one instance of each timer 
     74proc bMotion_diagnostic_timers { } { 
     75  bMotion_putloglev d * "running level 4 diagnostic on timers" 
     76  set alltimers [timers] 
     77  set seentimers [list] 
     78  foreach t $alltimers { 
     79    bMotion_putloglev 1 * "checking timer $t" 
     80    set t_function [lindex $t 1] 
     81    set t_name [lindex $t 2] 
     82    set t_function [string tolower $t_function] 
     83    if {[lsearch $seentimers $t_function] >= 0} { 
     84      putlog "bMotion: A level 4 diagnostic has found a duplicate timer $t_name for $t_function ... removing" 
     85      #remove timer 
     86    } else { 
     87      #add to seen list 
     88      lappend seentimers $t_function 
     89    } 
     90  } 
     91} 
     92 
     93# 
     94# make sure we have only one instance of each utimer 
     95proc bMotion_diagnostic_utimers { } { 
     96  bMotion_putloglev d * "running level 4 diagnostic on utimers" 
     97  set alltimers [utimers] 
     98  set seentimers [list] 
     99  foreach t $alltimers { 
     100    bMotion_putloglev 1 * "checking timer $t" 
     101    set t_function [lindex $t 1] 
     102    set t_name [lindex $t 2] 
     103    set t_function [string tolower $t_function] 
     104    if {[lsearch $seentimers $t_function] >= 0} { 
     105      putlog "bMotion: A level 4 diagnostic has found a duplicate utimer $t_name for $t_function ... removing" 
     106      #remove timer 
     107    } else { 
     108      #add to seen list 
     109      lappend seentimers $t_function 
     110    } 
     111  } 
     112} 
     113 
     114proc bMotion_diagnostic_auto { min hr a b c } { 
     115  putlog "bMotion: running level 4 self-diagnostic" 
     116  bMotion_diagnostic_timers 
     117  bMotion_diagnostic_utimers 
     118} 
    72119 
    73120bMotion_putloglev d * "Running a level 5 self-diagnostic..." 
     
    77124 
    78125bMotion_putloglev d * "Diagnostics complete." 
     126 
     127bind time - "30 * * * *" bMotion_abstract_auto 
Note: See TracChangeset for help on using the changeset viewer.