Files
wwtools/mbproxy/src/Mbproxy/Proxy/Cache/CacheLogEvents.cs
T
Joseph Doherty 7466a46aa7 mbproxy/docs: retire superseded design/plan docs and dissolve DL260/
The standalone design.md, kpi.md, operations.md, and the docs/plan/
phase tree were point-in-time planning artefacts now superseded by the
topic-organized docs/ tree (Architecture/, Features/, Operations/,
Reference/, Testing/). The DL260/ folder mixed a device-reference doc, a
test fixture, a sample test, and a screenshot; its contents now live in
their natural homes (dl205.md + mbtcp_settings.JPG under docs/Reference/,
dl205.json next to its launcher in tests/sim/, sample test dropped).

All cross-references in the surviving docs, README, CLAUDE.md, the config
template, and source comments are repointed to the new locations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 07:37:48 -04:00

78 lines
2.5 KiB
C#

namespace Mbproxy.Proxy.Cache;
/// <summary>
/// Source-generated <see cref="LoggerMessage"/> definitions for the response cache.
/// Event names are stable — do not rename without updating <c>docs/Reference/LogEvents.md</c>'s
/// Logging event-name table.
///
/// <para>Levels are conservative — a busy PLC under steady cache pressure would emit one
/// Hit / Miss per FC03/FC04 request. The counters surface the same data at far lower cost
/// for monitoring; Debug-level events are present for incident-time diagnosis only.</para>
/// </summary>
internal static partial class CacheLogEvents
{
[LoggerMessage(
EventId = 140,
EventName = "mbproxy.cache.hit",
Level = LogLevel.Debug,
Message = "Cache hit: Plc={Plc} Unit={UnitId} Fc={Fc} Start={Start} Qty={Qty}")]
public static partial void Hit(
ILogger logger,
string plc,
byte unitId,
byte fc,
ushort start,
ushort qty);
[LoggerMessage(
EventId = 141,
EventName = "mbproxy.cache.miss",
Level = LogLevel.Debug,
Message = "Cache miss: Plc={Plc} Unit={UnitId} Fc={Fc} Start={Start} Qty={Qty}")]
public static partial void Miss(
ILogger logger,
string plc,
byte unitId,
byte fc,
ushort start,
ushort qty);
[LoggerMessage(
EventId = 142,
EventName = "mbproxy.cache.store",
Level = LogLevel.Debug,
Message = "Cache store: Plc={Plc} Unit={UnitId} Fc={Fc} Start={Start} Qty={Qty} TtlMs={TtlMs}")]
public static partial void Store(
ILogger logger,
string plc,
byte unitId,
byte fc,
ushort start,
ushort qty,
int ttlMs);
[LoggerMessage(
EventId = 143,
EventName = "mbproxy.cache.invalidated",
Level = LogLevel.Debug,
Message = "Cache invalidated: Plc={Plc} Unit={UnitId} WriteStart={WriteStart} WriteQty={WriteQty} Count={Count}")]
public static partial void Invalidated(
ILogger logger,
string plc,
byte unitId,
ushort writeStart,
ushort writeQty,
int count);
[LoggerMessage(
EventId = 144,
EventName = "mbproxy.cache.flushed",
Level = LogLevel.Information,
Message = "Cache flushed: Plc={Plc} Reason={Reason} Count={Count}")]
public static partial void Flushed(
ILogger logger,
string plc,
string reason,
int count);
}