Subclassing execute() and query() methods within your
CGI::Application seems like the right approach for a request based counter. But tracking database slowpoints should be done via the database logs. Most databases will allow you to log any query which takes longer than a specified time period, which you can set in the configuration file. Here's an example from my Postgresql database conf file:
log_min_duration_statement = 420 # -1 is disabled, in milliseconds.