=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -45,6 +45,7 @@ public class SendAlertService(
|
||||
/// If the Rabbit connection string is not defined in the web config, an error is logged and an empty list is returned.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="Queue"/> objects, or an empty list if the Rabbit connection string is not configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=8b94d31 body=8aa2b12 -->
|
||||
public async Task<List<Queue>> GetQueues()
|
||||
{
|
||||
if (_rabbitConnectionString != null) return await GetQueuesAsync();
|
||||
@@ -59,6 +60,7 @@ public class SendAlertService(
|
||||
/// Logs and suppresses any errors encountered while collecting the data, returning the successfully gathered metrics.
|
||||
/// </summary>
|
||||
/// <returns>A list of <see cref="Performance"/> entries containing the collected performance metrics; returns an empty list if all collection attempts fail.</returns>
|
||||
/// <!-- aidoc:v1 sig=2be2617 body=a3f4d4b -->
|
||||
public List<Performance> GetPerformance()
|
||||
{
|
||||
logger.LogDebug("Starting check performance data from hospitals");
|
||||
@@ -84,6 +86,7 @@ public class SendAlertService(
|
||||
/// Asynchronously retrieves a list of API clients by delegating to the underlying data retrieval method.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation, containing the list of <see cref="ApiClients"/> instances retrieved.</returns>
|
||||
/// <!-- aidoc:v1 sig=74b1e47 body=7ebcae0 -->
|
||||
public async Task<List<ApiClients>> GetApiClients()
|
||||
{
|
||||
return await GetApiClientsAsync();
|
||||
@@ -93,6 +96,7 @@ public class SendAlertService(
|
||||
/// Asynchronously retrieves statistics for the configured RabbitMQ error queues (recording, patients, treatments, observations, and pumps). Only queues with non-empty names are queried, duplicates are ignored, and any exception raised while connecting or fetching stats is logged and results in an empty list being returned.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="Queue"/> objects with the name, message count, and consumer count of each queried queue, or an empty list if an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=97010df body=95afb89 -->
|
||||
private async Task<List<Queue>> GetQueuesAsync()
|
||||
{
|
||||
logger.LogDebug("Starting check rabbitMQ data from hospitals");
|
||||
@@ -151,6 +155,7 @@ public class SendAlertService(
|
||||
/// Calculates usage from total processor time divided by processor count, and returns a default Performance instance if the underlying process query fails.
|
||||
/// </summary>
|
||||
/// <returns>A Performance object describing the CPU usage percentage, total capacity, and unit. If an error occurs, a default Performance instance is returned and the exception is logged.</returns>
|
||||
/// <!-- aidoc:v1 sig=a7e6e3d body=875a1c4 -->
|
||||
public Performance GetConsumedCpu()
|
||||
{
|
||||
Performance performance = new();
|
||||
@@ -180,6 +185,7 @@ public class SendAlertService(
|
||||
/// Retrieves the current RAM consumption in gigabytes, returning it as a Performance metric where the total and consumed values are reported as equal with a consumption percentage of 100. If an error occurs while retrieving the memory information, the exception is logged and an empty Performance object is returned.
|
||||
/// </summary>
|
||||
/// <returns>A Performance object representing the RAM usage in GB; returns an empty Performance object if the memory retrieval fails.</returns>
|
||||
/// <!-- aidoc:v1 sig=6b014f3 body=8c40f98 -->
|
||||
public Performance GetConsumedRam()
|
||||
{
|
||||
Performance performance = new();
|
||||
@@ -211,6 +217,7 @@ public class SendAlertService(
|
||||
/// </summary>
|
||||
/// <param name="drive">The drive whose storage consumption is to be measured.</param>
|
||||
/// <returns>A <see cref="Performance"/> instance containing the consumed storage, total storage, percentage consumed, and the unit (GB) for the drive.</returns>
|
||||
/// <!-- aidoc:v1 sig=d432443 body=b8cb174 -->
|
||||
public Performance GetConsumedStorage(DriveInfo drive)
|
||||
{
|
||||
Performance performance = new();
|
||||
@@ -258,6 +265,7 @@ public class SendAlertService(
|
||||
/// <returns>A list of <see cref="Performance"/> entries describing the consumed storage for each
|
||||
/// successfully processed drive; returns an empty list if no drives yield results or if an
|
||||
/// error occurs during enumeration.</returns>
|
||||
/// <!-- aidoc:v1 sig=1a15ba5 body=724e81c -->
|
||||
private List<Performance> GetConsumedStorages()
|
||||
{
|
||||
var list = new List<Performance>();
|
||||
@@ -292,6 +300,7 @@ public class SendAlertService(
|
||||
/// Returns an empty list if the underlying call returns null or fails; any exception is caught and logged without being rethrown.
|
||||
/// </summary>
|
||||
/// <returns>A task that resolves to the list of connected API clients, which may be empty if no clients were retrieved.</returns>
|
||||
/// <!-- aidoc:v1 sig=3d33350 body=519c9d5 -->
|
||||
private async Task<List<ApiClients>> GetApiClientsAsync()
|
||||
{
|
||||
logger.LogDebug("Starting check conected clients from hospitals");
|
||||
@@ -317,6 +326,10 @@ public class SendAlertService(
|
||||
/// Asynchronously retrieves the list of connected WebSocket API clients, handling any errors by logging them and returning an empty <see cref="ApiClients"/> instance as a fallback.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="Task{TResult}"/> that resolves to an <see cref="ApiClients"/> instance representing the connected WebSocket subscribers.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=stale_summary
|
||||
/// "The summary states the method 'retrieves the list of connected WebSocket API clients', but the actual retrieval code (`webSocketHandler.GetSubscribersConected()`) is commented out. The method only ever constructs a new empty ApiClients and returns it." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_returns
|
||||
/// "The <returns> tag documents a non-nullable ApiClients instance, but the method's return type is Task<ApiClients?> (nullable)." -->
|
||||
private Task<ApiClients?> GetWebSocketClients()
|
||||
{
|
||||
ApiClients apiClients = new();
|
||||
|
||||
Reference in New Issue
Block a user