using System.Diagnostics.Metrics;

namespace StellaOps.Feedser.WebService.Diagnostics;

internal static class JobMetrics
{
    internal const string MeterName = "StellaOps.Feedser.WebService.Jobs";

    private static readonly Meter Meter = new(MeterName);

    internal static readonly Counter<long> TriggerCounter = Meter.CreateCounter<long>(
        "web.jobs.triggered",
        unit: "count",
        description: "Number of job trigger requests accepted by the web service.");

    internal static readonly Counter<long> TriggerConflictCounter = Meter.CreateCounter<long>(
        "web.jobs.trigger.conflict",
        unit: "count",
        description: "Number of job trigger requests that resulted in conflicts or rejections.");

    internal static readonly Counter<long> TriggerFailureCounter = Meter.CreateCounter<long>(
        "web.jobs.trigger.failed",
        unit: "count",
        description: "Number of job trigger requests that failed at runtime.");
}
