summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/PerformanceMonitoring/PeakEntry.cs
blob: 1746e358c8477fd45e435a8528e6a140cb707738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;

namespace StardewModdingAPI.Framework.PerformanceMonitoring
{
    /// <summary>A peak invocation time.</summary>
    internal readonly struct PeakEntry
    {
        /*********
        ** Accessors
        *********/
        /// <summary>The actual execution time in milliseconds.</summary>
        public double ExecutionTimeMilliseconds { get; }

        /// <summary>When the entry occurred.</summary>
        public DateTime EventTime { get; }

        /// <summary>The sources involved in exceeding the threshold.</summary>
        public AlertContext[] Context { get; }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="executionTimeMilliseconds">The actual execution time in milliseconds.</param>
        /// <param name="eventTime">When the entry occurred.</param>
        /// <param name="context">The sources involved in exceeding the threshold.</param>
        public PeakEntry(double executionTimeMilliseconds, DateTime eventTime, AlertContext[] context)
        {
            this.ExecutionTimeMilliseconds = executionTimeMilliseconds;
            this.EventTime = eventTime;
            this.Context = context;
        }
    }
}