| 47 | } |
| 48 | |
| 49 | ACTOR Future<Void> work(Database cx, DDMetricsWorkload* self) { |
| 50 | try { |
| 51 | TraceEvent("DDMetricsWaiting").detail("StartDelay", self->startDelay); |
| 52 | wait(delay(self->startDelay)); |
| 53 | TraceEvent("DDMetricsStarting").log(); |
| 54 | state double startTime = now(); |
| 55 | loop { |
| 56 | wait(delay(2.5)); |
| 57 | int dif = wait(self->getHighPriorityRelocationsInFlight(cx, self)); |
| 58 | TraceEvent("DDMetricsCheck").detail("DIF", dif); |
| 59 | if (dif == 0) { |
| 60 | self->ddDone = now() - startTime; |
| 61 | return Void(); |
| 62 | } |
| 63 | } |
| 64 | } catch (Error& e) { |
| 65 | TraceEvent("DDMetricsError").error(e); |
| 66 | } |
| 67 | return Void(); |
| 68 | } |
| 69 | |
| 70 | Future<Void> start(Database const& cx) override { return clientId == 0 ? work(cx, this) : Void(); } |
| 71 |
nothing calls this directly
no test coverage detected