tony2001 / pinba_extension

Pinba PHP extension
http://pinba.org
GNU Lesser General Public License v2.1
83 stars 22 forks source link

pinba_reset does not delete existing timers #41

Open gggeek opened 1 year ago

gggeek commented 1 year ago

Tested on pinba-php from Ubuntu Focal:

$t1 = pinba_timer_start(array('timerNr' => '1'));
pinba_tag_set('yo', 'lo');
var_dump(count(pinba_timers_get())); // 1
var_dump(count(pinba_tags_get())); // 1
pinba_reset();
echo "--\n";
var_dump(count(pinba_timers_get())); // 1 !!!
var_dump(count(pinba_tags_get())); // 0

I am not 100% sure about the intended behaviour, but I'd say that a "reset" function should clean up everything.

ATM, the workaround I found, is: in order to delete all timers, ini_set pinba_enabled to 0, call flush(), then reset pinba_enabled to its original value