Skip to content

Commit 7fd9fec

Browse files
committed
Add datadog output for preserve state changes
1 parent 4a0b062 commit 7fd9fec

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

osu.Server.Queues.ScoreStatisticsProcessor/Commands/Maintenance/DeleteNonPreservedScoresCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using osu.Server.QueueProcessor;
1616
using osu.Server.Queues.ScoreStatisticsProcessor.Helpers;
1717
using osu.Server.Queues.ScoreStatisticsProcessor.Models;
18+
using StatsdClient;
1819

1920
namespace osu.Server.Queues.ScoreStatisticsProcessor.Commands.Maintenance
2021
{
@@ -37,6 +38,11 @@ public class DeleteNonPreservedScoresCommand
3738

3839
public async Task<int> OnExecuteAsync(CancellationToken cancellationToken)
3940
{
41+
DogStatsd.Configure(new StatsdConfig
42+
{
43+
Prefix = "osu.server.commands.mark_non_preserved",
44+
});
45+
4046
using var db = await DatabaseAccess.GetConnectionAsync(cancellationToken);
4147
using var s3 = S3.GetClient();
4248

@@ -143,6 +149,7 @@ private async Task processPartitionAsync(MySqlConnection db, Amazon.S3.IAmazonS3
143149

144150
if (!DryRun)
145151
{
152+
DogStatsd.Increment("replays_deleted");
146153
DeleteObjectResponse? deleteResult = await s3.DeleteObjectAsync(S3.REPLAYS_BUCKET, score.id.ToString(CultureInfo.InvariantCulture), cancellationToken);
147154

148155
switch (deleteResult.HttpStatusCode)

osu.Server.Queues.ScoreStatisticsProcessor/Commands/Maintenance/MarkNonPreservedScoresCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using osu.Server.QueueProcessor;
1616
using osu.Server.Queues.ScoreStatisticsProcessor.Helpers;
1717
using osu.Server.Queues.ScoreStatisticsProcessor.Models;
18+
using StatsdClient;
1819

1920
namespace osu.Server.Queues.ScoreStatisticsProcessor.Commands.Maintenance
2021
{
@@ -40,6 +41,11 @@ public class MarkNonPreservedScoresCommand
4041

4142
public async Task<int> OnExecuteAsync(CancellationToken cancellationToken)
4243
{
44+
DogStatsd.Configure(new StatsdConfig
45+
{
46+
Prefix = "osu.server.commands.mark_non_preserved",
47+
});
48+
4349
Stopwatch stopwatch = Stopwatch.StartNew();
4450

4551
if (!DryRun)
@@ -163,6 +169,7 @@ STRAIGHT_JOIN scores s FORCE INDEX (beatmap_user_index)
163169

164170
userMarkedCount++;
165171
totalMarked++;
172+
DogStatsd.Increment("total_marked");
166173

167174
if (Verbose)
168175
{

0 commit comments

Comments
 (0)