Created
October 14, 2021 12:30
-
-
Save FrancescoBonizzi/519a892d74862b11fc61591ebb33bcb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private (bool IsCritical, MonitoringData Data) ValueCritical( | |
MonitoringData[] monitoringData, | |
DateTime startingDate, | |
Metrics metric, | |
double threshold) | |
{ | |
foreach (var data in monitoringData | |
.Where(d => d.CollectionTime > startingDate) | |
.OrderByDescending(d => d.CollectionTime)) | |
{ | |
if (data.Metric == metric && data.MetricValue > threshold) | |
{ | |
return (true, data); | |
} | |
} | |
return (false, null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment