| 54 | } |
| 55 | |
| 56 | void testReconfigure() { |
| 57 | StatsdServer server; |
| 58 | throwOnError(server); |
| 59 | |
| 60 | StatsdClient client("localhost", 8125, "first."); |
| 61 | client.increment("foo"); |
| 62 | throwOnWrongMessage(server, "first.foo:1|c"); |
| 63 | |
| 64 | client.setConfig("localhost", 8125, "second"); |
| 65 | client.increment("bar"); |
| 66 | throwOnWrongMessage(server, "second.bar:1|c"); |
| 67 | |
| 68 | client.setConfig("localhost", 8125, ""); |
| 69 | client.increment("third.baz"); |
| 70 | throwOnWrongMessage(server, "third.baz:1|c"); |
| 71 | |
| 72 | client.increment(""); |
| 73 | throwOnWrongMessage(server, ":1|c"); |
| 74 | |
| 75 | // TODO: test what happens with the batching after resolving the question about incomplete |
| 76 | // batches being dropped vs sent on reconfiguring |
| 77 | } |
| 78 | |
| 79 | void testSendRecv(uint64_t batchSize, uint64_t sendInterval) { |
| 80 | StatsdServer mock_server; |
no test coverage detected