Skip to content

Instantly share code, notes, and snippets.

@FrancescoBonizzi
Created October 14, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrancescoBonizzi/519a892d74862b11fc61591ebb33bcb7 to your computer and use it in GitHub Desktop.
Save FrancescoBonizzi/519a892d74862b11fc61591ebb33bcb7 to your computer and use it in GitHub Desktop.
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