I'm working on a backend migration on some scala code. The code current returns com.twitter.util.Future[A] and I am taking the response from my new backend and transforming it into Future[A] as well
To monitor the migration, I want to do a comparison so I can tell how often the response from the 2 backends differ, so I have something like
val b1Resp: Future[A] = getResponseFromBackend1()
val b2Resp: Future[A] = getResponseFromBackend2() map { resp => convert(resp)}
return b1Resp
I want to verify that the results of the futures are either the same or that they both fail. On discrepancies, I will be publishing a metric.
Moreover, I don't want to delay the return. I don't really care when the metric is published (within reason of course), so it's okay to allow execution to continue
How do I do the comparison?