If you haven't already solved your problem, you might look at the following flow. It is loosely based on Dean's suggestion of a leaky bucket algorithm. The trend is computed from the outputs of two smoothing nodes, one of which averages over a long sample and the other over a short one. Both smoothing nodes are fed by your exception source and by a clock that generates inputs at a rate much higher than the exception rate. The clock very nearly, but not quite, converts the averaging basis to time rather than events. The discrepancy, which is small for low exception rates, could be corrected by some additional calculation, if necessary. The switch and topic timeframe trigger modes are there to see that the trend is always computed from current data; there may be better ways to handle that.
Mike
[{"id":"7954f7fe.86ab08","type":"inject","z":"f09d051b.0f62f8","name":"Clock","topic":"","payload":"0","payloadType":"num","repeat":"1","crontab":"","once":false,"x":90,"y":40,"wires":[["ba6c6ca8.45939","2d30e60a.d2cf1a"]]},{"id":"76f6e837.890918","type":"inject","z":"f09d051b.0f62f8","name":"Input","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"x":90,"y":120,"wires":[["ba6c6ca8.45939","2d30e60a.d2cf1a"]]},{"id":"a2270350.5dd9","type":"smooth","z":"f09d051b.0f62f8","name":"Short","action":"mean","count":"10","round":"","x":430,"y":120,"wires":[["435b003c.bca5"]]},{"id":"ba6c6ca8.45939","type":"change","z":"f09d051b.0f62f8","name":"topic=long","rules":[{"t":"set","p":"topic","pt":"msg","to":"long","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":40,"wires":[["db4690d2.24b97"]]},{"id":"db4690d2.24b97","type":"smooth","z":"f09d051b.0f62f8","name":"Long","action":"mean","count":"100","round":"","x":430,"y":40,"wires":[["ceb46457.314b98"]]},{"id":"2d30e60a.d2cf1a","type":"change","z":"f09d051b.0f62f8","name":"topic=short","rules":[{"t":"set","p":"topic","pt":"msg","to":"short","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":120,"wires":[["a2270350.5dd9"]]},{"id":"af991dfe.5066e","type":"function","z":"f09d051b.0f62f8","name":"Trend","func":"var long = flow.get('long');\nvar short = flow.get('short');\nvar trend = 0;\nif (long !== 0) {\n trend = (short - long) / long;\n}\nmsg.payload = trend;\nnode.status({text:trend.toFixed(1)});\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":80,"wires":[["9726be65.68d94"]]},{"id":"9726be65.68d94","type":"debug","z":"f09d051b.0f62f8","name":"","active":false,"console":"false","complete":"true","x":950,"y":80,"wires":[]},{"id":"ceb46457.314b98","type":"function","z":"f09d051b.0f62f8","name":"Set long","func":"var long = flow.set('long',msg.payload);\nlong = flow.get('long');\nnode.status({text:long.toFixed(2)});\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":40,"wires":[["9ec4ff9d.613b"]]},{"id":"435b003c.bca5","type":"function","z":"f09d051b.0f62f8","name":"Set short","func":"var short = flow.set('short',msg.payload);\nshort = flow.get('short');\nnode.status({text:short.toFixed(2)});\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":120,"wires":[["9ec4ff9d.613b"]]},{"id":"9ec4ff9d.613b","type":"topic-timeframe-trigger","z":"f09d051b.0f62f8","name":"Trigger","topics":"2","count":"1","timeframe":"1","triggeredtopic":"triggered","triggeredpayload":"go","x":710,"y":80,"wires":[["af991dfe.5066e"]]}]