I want TIMESTAMP to be evaluated automatically by the expression language engine to build a timestamp in the correct format based on the current date/time.
Is it possible to store a function that returns a string into TIMESTAMP, and have the expression language call that function in order to get the value to interpolate into the string?
Is this the best way to go to inject data into the session to be used by the Gattling EL?
I was trying to do the same as you today and started uit with an Array for a custom feeder but that got evaluated immediately and I was stuck with the same DateTime value as when it got evaluated.
You solution does work for me but does this mean that I have to this for all my “non static” data that I want to use with Gatling EL?
I have a csv feeder for pre defined data like Person.name and Person.gender but I also need to do some calculation per request. I figured that maybe creating a feeder that contains something like a <key, function> would do the trick but I haven’t found it.
But then, the value of C is only updated when that exec() statement is executed. It would be NICE to be able to compose an expression that is evaluated every time it is converted to a string, but to the best of my knowledge, that doesn’t work.
The trick with the date/time worked only because it did not need access to the session.
That said, Scala is a pretty powerful language. Who knows what kind of crazy wonderful trickery you might be capable of doing to make it do what you want. I’d be interested, just from the geekyness factor. If I come up with something, I’ll let you know. I trust you will do likewise.
Yeah I’d be interested in the solution as well. I’m going to dust off my Scala knowledge, the syntax kinda slipped away a bit. But when I do get a satisfactory solution to this I’ll definitely post it here.