Is there a way to not store a custom timer (started via the MeasureStart funtion) in case a certain condition is met? I can see from the response data that sometimes there was an error, and during those cases I want to ignore / not count the response time at all. I tried to do this from several angles, but ultimately didn't accomplish my goal. I did manage to set the response time to "0" for those "error" cases, which is better than nothing I guess. Here's what I did, explained via pseudo code:
IF [error not found] THEN MeasureStop
--> So I only entered the MeasureStop function if the error was verified to not be there. My presumption was that if you never end the timer, it doesn't store it.
--> Unfortunately I was wrong, it uses the main transaction end time as the end time for the custom timer, so this resulted in completely false data.
IF [error found] THEN exit transaction
--> I split the various custom timers into separate subtransactions TMain, TMain2, TMain3, etc., and exited that transaction via "return 0" if the error was found.
--> The subtransactions actually appeared as new transactions in the TM ART GUI, which made everything look quite messy. But the biggest problem was that even though I exited the entire transaction before the custom timer ended, it STILL saved the response time. At this point I pretty much gave up, and decided to try a different approach.
IF [error found] THEN set custom timer = "0"
--> I thought I could at least make the "wrong" data differ from the real data, by setting it to be zero. That way I can e.g. search for data straight from the database with the clause "if value > 0".
--> I used the function MeasureSet and it appeared to work at first. Unfortunately when looking at the results from the GUI, I noticed that it also saves the original measure. So it's not really an act of "replacing" data, it just adds another result under that timer name; so for a single run, it would save e.g. 1.4 seconds and 0 seconds, resulting in Count = 2 and Average = 0.7. This again results in completely false data.
Save response time into TEMP timer
IF [error not found] THEN save TEMP timer into REAL timer ELSE set REAL timer = "0"
--> This way I only get one "real" timer per each run, and loads of "temp" timers which I can just ignore.
--> Best one so far, I get a single result for each custom timer, and it's either 0, or in case of no errors, the actual response time.
Of course I would prefer that if the error comes up, the response time wouldn't be saved at all. Is there any way to achieve this?