Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 6 additions & 29 deletions slo/src/Internal/SloTableContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using NLog.Extensions.Logging;
using Prometheus;
using Ydb.Sdk;
using Ydb.Sdk.Ado;

namespace Internal;

Expand Down Expand Up @@ -151,11 +150,6 @@ async Task ShootingTask(RateLimiter rateLimitPolicy, string operationType, Func<
"Total number of successful operations, categorized by type."
);

var operationsFailureTotal = metricFactory.CreateCounter(
"sdk_operations_failure_total",
"Total number of failed operations, categorized by type."
);

var operationLatencySeconds = metricFactory.CreateHistogram(
"sdk_operation_latency_seconds",
"Latency of operations performed by the SDK in seconds, categorized by type and status.",
Expand Down Expand Up @@ -186,12 +180,6 @@ async Task ShootingTask(RateLimiter rateLimitPolicy, string operationType, Func<
"Current number of pending operations, categorized by type."
);

var errorsTotal = metricFactory.CreateCounter(
"sdk_errors_total",
"Total number of errors encountered, categorized by error type.",
["error_type"]
);

var workJobs = new List<Task>();

for (var i = 0; i < 10; i++)
Expand All @@ -210,23 +198,12 @@ async Task ShootingTask(RateLimiter rateLimitPolicy, string operationType, Func<

pendingOperations.Inc();
var sw = Stopwatch.StartNew();
try
{
await action(client, runConfig);
sw.Stop();
operationsTotal.Inc();
pendingOperations.Dec();
operationsSuccessTotal.Inc();
operationLatencySeconds.WithLabels("success").Observe(sw.Elapsed.TotalSeconds);
}
catch (YdbException e)
{
Logger.LogError(e, "Fail operation!");

errorsTotal.WithLabels(e.Code.StatusName()).Inc();
operationsFailureTotal.Inc();
operationLatencySeconds.WithLabels("err").Observe(sw.Elapsed.TotalSeconds);
}
await action(client, runConfig);
sw.Stop();
operationsTotal.Inc();
pendingOperations.Dec();
operationsSuccessTotal.Inc();
operationLatencySeconds.WithLabels("success").Observe(sw.Elapsed.TotalSeconds);
}
}, cancellationTokenSource.Token));
}
Expand Down
Loading