1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 14:53:21 +08:00

Merge pull request #16594 from peppy/realm-subscription-tracking

Add tracking of total realm subscriptions
This commit is contained in:
Dan Balasescu 2022-01-25 16:46:53 +09:00 committed by GitHub
commit 6e531a574d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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--;
}
}
}