Skip to content

Commit

Permalink
Add datadog output of indexing stats
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jan 24, 2024
1 parent 40aa41b commit 7465118
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions osu.ElasticIndexer/ProcessableItemsBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Linq;
using MySqlConnector;
using StatsdClient;

namespace osu.ElasticIndexer
{
Expand Down Expand Up @@ -57,9 +58,15 @@ public ProcessableItemsBuffer(MySqlConnection connection, IEnumerable<ScoreQueue
foreach (var score in scores)
{
if (score.ShouldIndex)
{
DogStatsd.Increment("indexed", 1, 1, new[] { "action:add", $"type:{(score.is_legacy ? "legacy" : "normal")}", $"ruleset:{score.ruleset_id}" });
Additions.Add(score);
}
else
{
DogStatsd.Increment("indexed", 1, 1, new[] { "action:remove", $"type:{(score.is_legacy ? "legacy" : "normal")}", $"ruleset:{score.ruleset_id}" });
Deletions.Add(score.id);
}

scoreIdsForLookup.Remove(score.id);
}
Expand Down

0 comments on commit 7465118

Please sign in to comment.