// This file is part of the EonaCat project(s) which is released under the Apache License.
// See the LICENSE file or go to https://EonaCat.com/License for full license details.

namespace EonaCat.LogStack.EonaCatLogStackCore
{
    /// <summary>
    /// Comprehensive logging statistics with per-level and per-category metrics
    /// </summary>
    public struct LogStats
    {
        // Basic counters
        public long Written;
        public long Dropped;
        public long Rotations;
        public long BytesWritten;
        public double WritesPerSecond;

        // Per-level counters
        public long TraceCount;
        public long DebugCount;
        public long InformationCount;
        public long WarningCount;
        public long ErrorCount;
        public long CriticalCount;

        // Error tracking
        public long ExceptionsLogged;
        public long DroppedErrors;

        // Performance metrics
        public double AverageEventLatencyMs;
        public double MinEventLatencyMs;
        public double MaxEventLatencyMs;

        // Memory metrics
        public long TotalEventsProcessed;
        public double AverageEventSizeBytes;

        public LogStats(long written, long dropped, long rotations, long bytesWritten, double writesPerSecond)
        {
            Written = written;
            Dropped = dropped;
            Rotations = rotations;
            BytesWritten = bytesWritten;
            WritesPerSecond = writesPerSecond;
            TraceCount = 0;
            DebugCount = 0;
            InformationCount = 0;
            WarningCount = 0;
            ErrorCount = 0;
            CriticalCount = 0;
            ExceptionsLogged = 0;
            DroppedErrors = 0;
            AverageEventLatencyMs = 0;
            MinEventLatencyMs = 0;
            MaxEventLatencyMs = 0;
            TotalEventsProcessed = 0;
            AverageEventSizeBytes = 0;
        }
    }
}