42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
export interface HealthStatus {
|
|
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
service: string;
|
|
timestamp: string;
|
|
uptime: number;
|
|
checks: {
|
|
database: {
|
|
status: 'ok' | 'error';
|
|
responseTime: number;
|
|
details?: string;
|
|
};
|
|
};
|
|
}
|
|
export declare class HealthService {
|
|
private readonly prisma;
|
|
private readonly startTime;
|
|
constructor(prisma: PrismaService);
|
|
getOverallHealth(): Promise<{
|
|
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
statusCode: number;
|
|
service: string;
|
|
timestamp: string;
|
|
uptime: number;
|
|
checks: {
|
|
database: {
|
|
status: 'ok' | 'error';
|
|
responseTime: number;
|
|
details?: string;
|
|
};
|
|
};
|
|
}>;
|
|
getDatabaseHealth(): Promise<{
|
|
status: 'ok' | 'error';
|
|
database: string;
|
|
responseTime: number;
|
|
timestamp: string;
|
|
details?: string;
|
|
statusCode: number;
|
|
}>;
|
|
}
|