Table of Contents

Class DbContextFactoryHealthExtensions

Namespace
FishMMO.Database.Npgsql.Monitoring.Health
Assembly
FishMMO-DB.dll

Extension methods for deriving connection pool health from an INpgsqlDbContextFactory.

public static class DbContextFactoryHealthExtensions
Inheritance
DbContextFactoryHealthExtensions
Inherited Members

Methods

GetConnectionPoolHealth(INpgsqlDbContextFactory, double, double)

Computes a point-in-time health assessment of the connection pool using runtime metrics.

public static PoolHealthResult GetConnectionPoolHealth(this INpgsqlDbContextFactory dbContextFactory, double warningThreshold = 70, double criticalThreshold = 85)

Parameters

dbContextFactory INpgsqlDbContextFactory

The DbContext factory that exposes pool metrics.

warningThreshold double

Pool utilization percentage threshold for warning status.

criticalThreshold double

Pool utilization percentage threshold for critical status.

Returns

PoolHealthResult

A PoolHealthResult describing current pool health.

Remarks

Thresholds are expressed as percentages of the configured pool size. Intended for telemetry/health endpoints.

Exceptions

ArgumentNullException

dbContextFactory is null.