For me stress piles up when there's a fix that doesn't take very long to do, but you are blocked from working (or even starting on it) for a period of time.
My most frustrating moments are getting stuck on the subway in the middle of the afternoon - desperately wanting to just get back to work so I can finish it.
Or when I'm out of the house and I have to leave to come back home before my work is wrapped up for the day - the entire time I'm doing something that isn't finishing my work for the day it's like my soul is screaming to just finish the work and be done with it.
This is compounded by how small the task that remains is. If you spend 30 minutes talking to me about a fix that could be done in 5 minutes, by the 20th minute of our conversation I begin to feel anxious to just start (and finish) the work before the conversation is over.
So I suppose you could say my formula is like this:
var developerStress = timeSpentNotWorkingOnFix / totalTimeFixRequires