in reply to Re: OO lifetime function stats mod, is this useful?
in thread OO lifetime function stats mod, is this useful?

The for loops were just for example, it could easily be one function you want to track. The coderefs are needed because I'm basically trying to wrap a function call with args and track it over time (actually intervals. Not neccassarily the same thing.) The coderef provides a generic hook for performing an action. Now some functions might be builtins or return "0 but true" so the boolean is a generic way to let you defined the truth test. It is an optional argument.

I could see several uses. You could use it to track and monitor the performance of a different aspects of a server (HTTP Requests,IO latency, memory usage, etc). Mainly what it's for.

-Lee

"To be civilized is to deny one's nature."
  • Comment on Re: Re: OO lifetime function stats mod, is this useful?

Replies are listed 'Best First'.
Re^3: OO lifetime function stats mod, is this useful?
by Aristotle (Chancellor) on Jun 28, 2002 at 15:52 UTC
    Then I think what you really want to do is to provide a generic statskeeper hook to use with Hook::WrapSub, as that will allow one to directly call the initial function, rather than creating an object that wraps a coderef and then calling execute() on it.

    Makeshifts last the longest.

      Well it might not be a function per say. It might be a statement or a series of functions or a method which needs it's state bound in the closure. Here's a simple example server monitor script. Note the module isn't done. I banged it out in a few hours and a few accessors and such are missing.