Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
using System;
|
|
using System.Diagnostics.Metrics;
|
|
|
|
namespace StellaOps.Concelier.Connector.Vndr.Adobe;
|
|
|
|
public sealed class AdobeDiagnostics : IDisposable
|
|
{
|
|
public const string MeterName = "StellaOps.Concelier.Connector.Vndr.Adobe";
|
|
private static readonly string MeterVersion = "1.0.0";
|
|
|
|
private readonly Meter _meter;
|
|
private readonly Counter<long> _fetchAttempts;
|
|
private readonly Counter<long> _fetchDocuments;
|
|
private readonly Counter<long> _fetchFailures;
|
|
private readonly Counter<long> _fetchUnchanged;
|
|
|
|
public AdobeDiagnostics()
|
|
{
|
|
_meter = new Meter(MeterName, MeterVersion);
|
|
_fetchAttempts = _meter.CreateCounter<long>(
|
|
name: "adobe.fetch.attempts",
|
|
unit: "operations",
|
|
description: "Number of Adobe index fetch operations.");
|
|
_fetchDocuments = _meter.CreateCounter<long>(
|
|
name: "adobe.fetch.documents",
|
|
unit: "documents",
|
|
description: "Number of Adobe advisory documents captured.");
|
|
_fetchFailures = _meter.CreateCounter<long>(
|
|
name: "adobe.fetch.failures",
|
|
unit: "operations",
|
|
description: "Number of Adobe fetch failures.");
|
|
_fetchUnchanged = _meter.CreateCounter<long>(
|
|
name: "adobe.fetch.unchanged",
|
|
unit: "documents",
|
|
description: "Number of Adobe advisories skipped due to unchanged content.");
|
|
}
|
|
|
|
public Meter Meter => _meter;
|
|
|
|
public void FetchAttempt() => _fetchAttempts.Add(1);
|
|
|
|
public void FetchDocument() => _fetchDocuments.Add(1);
|
|
|
|
public void FetchFailure() => _fetchFailures.Add(1);
|
|
|
|
public void FetchUnchanged() => _fetchUnchanged.Add(1);
|
|
|
|
public void Dispose() => _meter.Dispose();
|
|
}
|