1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Add tracking of total subscriptions

This commit is contained in:
Dean Herbert 2022-01-24 20:23:10 +09:00
parent 05a2d7fbfe
commit 5fb9b58c9b

View File

@ -83,6 +83,8 @@ namespace osu.Game.Database
private static readonly GlobalStatistic<int> realm_instances_created = GlobalStatistics.Get<int>(@"Realm", @"Instances (Created)");
private static readonly GlobalStatistic<int> total_subscriptions = GlobalStatistics.Get<int>(@"Realm", @"Subscriptions");
private readonly object realmLock = new object();
private Realm? updateRealm;
@ -289,6 +291,8 @@ namespace osu.Game.Database
var syncContext = SynchronizationContext.Current;
total_subscriptions.Value++;
registerSubscription(action);
// This token is returned to the consumer.
@ -309,6 +313,7 @@ namespace osu.Game.Database
unsubscriptionAction?.Dispose();
customSubscriptionsResetMap.Remove(action);
notificationsResetMap.Remove(action);
total_subscriptions.Value--;
}
}
}