-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b74b247
commit 6b88d1c
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Jeffpardy | ||
{ | ||
[ApiController] | ||
[Route("api/Diagnostics")] | ||
public class DiagnosticsController : Controller | ||
{ | ||
[HttpGet] | ||
public JeffpardyDiagnostics GetDiagnostics() | ||
{ | ||
return new JeffpardyDiagnostics(); | ||
} | ||
|
||
} | ||
|
||
public class JeffpardyDiagnostics | ||
{ | ||
public int NumJeopardyCategories | ||
{ | ||
get | ||
{ | ||
return SeasonManifestCache.Instance.JeopardyCategoryList.Count; | ||
} | ||
} | ||
|
||
public int NumSuperJeffpardyCategories | ||
{ | ||
get | ||
{ | ||
return SeasonManifestCache.Instance.DoubleJeopardyCategoryList.Count; | ||
} | ||
} | ||
|
||
public int NumFinalJeffpardyCategories | ||
{ | ||
get | ||
{ | ||
return SeasonManifestCache.Instance.FinalJeopardyCategoryList.Count; | ||
} | ||
} | ||
|
||
public int NumCategories | ||
{ | ||
get | ||
{ | ||
return SeasonManifestCache.Instance.JeopardyCategoryList.Count + | ||
SeasonManifestCache.Instance.DoubleJeopardyCategoryList.Count + | ||
SeasonManifestCache.Instance.FinalJeopardyCategoryList.Count; | ||
} | ||
} | ||
|
||
public DateTime OldestCategory | ||
{ | ||
get | ||
{ | ||
var allCategories = SeasonManifestCache.Instance.JeopardyCategoryList.Concat(SeasonManifestCache.Instance.DoubleJeopardyCategoryList).Concat(SeasonManifestCache.Instance.FinalJeopardyCategoryList); | ||
return allCategories.Min(c => c.AirDate); | ||
} | ||
} | ||
|
||
public DateTime NewestCategory | ||
{ | ||
get | ||
{ | ||
var allCategories = SeasonManifestCache.Instance.JeopardyCategoryList.Concat(SeasonManifestCache.Instance.DoubleJeopardyCategoryList).Concat(SeasonManifestCache.Instance.FinalJeopardyCategoryList); | ||
return allCategories.Max(c => c.AirDate); | ||
} | ||
} | ||
} | ||
} |