fix: Improve graceful shutdown
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import Metrics from "../logging/metrics";
|
||||
|
||||
export default class Tracing {
|
||||
async onCreateDocument({
|
||||
onCreateDocument({
|
||||
documentName,
|
||||
instance,
|
||||
}: {
|
||||
@@ -17,11 +17,11 @@ export default class Tracing {
|
||||
);
|
||||
}
|
||||
|
||||
async onAuthenticationFailed({ documentName }: { documentName: string }) {
|
||||
onAuthenticationFailed({ documentName }: { documentName: string }) {
|
||||
Metrics.increment("collaboration.authentication_failed", { documentName });
|
||||
}
|
||||
|
||||
async onConnect({
|
||||
onConnect({
|
||||
documentName,
|
||||
instance,
|
||||
}: {
|
||||
@@ -35,7 +35,7 @@ export default class Tracing {
|
||||
);
|
||||
}
|
||||
|
||||
async onDisconnect({
|
||||
onDisconnect({
|
||||
documentName,
|
||||
instance,
|
||||
}: {
|
||||
@@ -54,7 +54,12 @@ export default class Tracing {
|
||||
);
|
||||
}
|
||||
|
||||
async onChange({ documentName }: { documentName: string }) {
|
||||
onChange({ documentName }: { documentName: string }) {
|
||||
Metrics.increment("collaboration.change", { documentName });
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
Metrics.gaugePerInstance("collaboration.connections_count", 0);
|
||||
Metrics.gaugePerInstance("collaboration.documents_count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user