summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 16:21:35 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 16:21:35 -0500
commitc8d627cdf2ae3126584ec2500877ff19987db17f (patch)
tree2cc6f604df00027239476acf3a74ae6bb0761323 /src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs
parentf976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da (diff)
parent17a9193fd28c527dcba40360702adb277736cc45 (diff)
downloadSMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.tar.gz
SMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.tar.bz2
SMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs')
-rw-r--r--src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs b/src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs
new file mode 100644
index 00000000..01197f74
--- /dev/null
+++ b/src/SMAPI/Framework/PerformanceMonitoring/AlertContext.cs
@@ -0,0 +1,34 @@
+namespace StardewModdingAPI.Framework.PerformanceMonitoring
+{
+ /// <summary>The context for an alert.</summary>
+ internal struct AlertContext
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The source which triggered the alert.</summary>
+ public string Source { get; }
+
+ /// <summary>The elapsed milliseconds.</summary>
+ public double Elapsed { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="source">The source which triggered the alert.</param>
+ /// <param name="elapsed">The elapsed milliseconds.</param>
+ public AlertContext(string source, double elapsed)
+ {
+ this.Source = source;
+ this.Elapsed = elapsed;
+ }
+
+ /// <summary>Get a human-readable text form of this instance.</summary>
+ public override string ToString()
+ {
+ return $"{this.Source}: {this.Elapsed:F2}ms";
+ }
+ }
+}