Forum Discussion

Craig_Jackson_2's avatar
Craig_Jackson_2
Icon for Nimbostratus rankNimbostratus
Feb 11, 2009

Initializing Statistics Profiles

How does one initialize a Statistics Profile?

 

 

I note that the STATS commands can't be used in RULE_INIT.

 

 

I'd like to keep a "max" value in a stats profile, but it has to start out at zero.

 

 

Craig

5 Replies

  • Ok, I just found "b profile stats reset".

     

     

    But it would be nice to be able to tie it to an iRule initialization.

     

     

    Craig
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hey Craig -

    Not the most optimal method, perhaps, since it uses a global var & has to test the var for each new conn, but give this a try:
    when RULE_INIT {  
       set ::stats_rst 1  
     }  
     when CLIENT_ACCEPTED {  
       if { $::stats_rst == 1 }{  
         STATS::set profilename fieldname 0  
         set ::stats_rst 0  
       }  
     }

    /deb
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    oops, value for STATS::set cmd obviously s/b 0, corrected code sample above...
  • We ran into the same issue in an iRule, so thanks for the workaround.

     

     

    We opened an RFE request case and got back CR117956 which requests the ability to set a stats profile field to arbitrary values in the RULE_INIT event.

     

     

    Aaron