When I run System.Remote.Monitoring.forkServerWith function the first time - it works perfectly. But if I killed the server explicitly (using serverThreadId) and then try to start it again with the same Store, the server cannot be launched because of an exception:
The name ""ekg.server_timestamp_ms"" is already taken by a metric.
CallStack (from HasCallStack):
error, called at ./System/Metrics.hs:214:5 in ekg-core-0.1.1.7-6wBeq6DHUUjI67QEVzudFR:System.Metrics
This is the first line in forkServerWith function:
Metrics.registerCounter "ekg.server_timestamp_ms" getTimeMs store
Unfortunately, there is no way to "unregister" this Counter before restarting of the server. So, what can I do?
When I run
System.Remote.Monitoring.forkServerWithfunction the first time - it works perfectly. But if I killed the server explicitly (usingserverThreadId) and then try to start it again with the sameStore, the server cannot be launched because of an exception:This is the first line in
forkServerWithfunction:Unfortunately, there is no way to "unregister" this
Counterbefore restarting of the server. So, what can I do?