Show failed request only after max retry but if succeed within try - aggregate the response time.

I am new to Gatling and have the following performance measurement scenario to test.

Web Application A (data center 1) is replicating data to Web Application B (data center 2). I have the following Gatling code that uploads a 500Mbyte file to Web Application A via HTTP. It then issues a head request to Web Application B to see if it received the file. Until the file is received by Web Application B, Web Applicaiton B will return error 404.

If Web Application B did not receive the file within 5 retries (5 seconds) - fail
If Web Application B receives the file within 5 - I would like the response time to be the total time i.e. 4 seconds for example and the status is not reported on the failed quadrant. How can I do this?

val scn = scenario (“Replication Test”)
.feed (feeder) - this gets a file to replicate
.repeat (count) { - this loops for a set of files
exec (
http (“replicate”)
.put (file) – this uploads file to Web Application A
.check( – check for success
).tryMax(5) – retry checking if file is replicated to Web Application B
exec (
http (“read file”)
.head (file)
.check( (1 second) – check for success

Thank You