Recently I’ve been confused at why my Timer count differed from my Transaction count in recent SilkPerformer test results. Having a second reference to compare SilkPerformer numbers against I had settled on the Timer count being the correct number to report as results but I still felt uneasy because I didn’t know why this was occurring. I finally sat down today and figured out why the numbers differed. Take a look at the following table of Transaction counts and Timer counts:
Notice that the tables are nearly identical but the transaction AnswerChallenge is significantly higher in the Transaction count table making the overall number higher/different (759476 vs. 258285 ). Seems odd, but after thinking through my script and transaction flow I finally figured out why AnswerChallenge varies between counters. Before I explain look at my actual user transactions declaration (user flow):
and then my the code for my AnswerChallenge transaction:
Notice that after the begin statement I check for the presence of two flags:
if (isChallenged = “Challenge”) OR (isForceChallenge = “ForceChallengeResponse”)
If the strings match the variable then the transaction CONTENTS will run, if they don’t the CONTENTS won’t run. Notice that inside of the if statement I have my timer (MeasureStart(“AnswerChallenge”);). AHH! Bingo… Do you see it? The transaction: AnswerChallenge is ALWAYS called due to the user transactions definition, but the CONTENTS of the transaction won’t be executed if the if statement is false. Thus, the transaction count ALWAYS grows regardless of the If statement results. If the if statement ends up being TRUE then the Timer count will go up (and this is the counter I care about).
See the visual difference with a TryScript:
From a programming point of view the behavior is obvious (with hind-sight). When perusing SilkPerformer reports.. not so obvious. Moral of the story: If you care about the count of transactions actually being sent over the wire, and you decide to run a transaction based on the result of another transaction, make sure to look at your Timer counts not your Transaction counts.