بنقرة واحدة
performance-monitoring
Logging, caching, health checks, and query optimization for SE104_VLEAGUE
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Logging, caching, health checks, and query optimization for SE104_VLEAGUE
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Swagger/OpenAPI setup and documentation patterns for SE104_VLEAGUE
Complete guide for the SE104_VLEAGUE React frontend — pages, services, components, auth flow, i18n, and patterns
Complete guide for testing patterns, test structure, CI pipeline, and development workflow for SE104_VLEAGUE
Complete guide for the SE104_VLEAGUE NestJS backend — modules, endpoints, Prisma schema, guards, interceptors, and patterns
JWT auth, OAuth, OTP verification, session management, RBAC for SE104_VLEAGUE
All business rules, state machines, scoring, regulations, and domain constraints for SE104_VLEAGUE
| name | Performance & Monitoring |
| description | Logging, caching, health checks, and query optimization for SE104_VLEAGUE |
| Feature | Status |
|---|---|
| Structured logging (nestjs-pino) | ✅ Implemented |
| Request timing (LoggingInterceptor) | ✅ Implemented |
| In-memory caching | ✅ Implemented (standings) |
| Health checks | ✅ Implemented |
| Rate limiting | ✅ Implemented (ThrottlerGuard) |
| Sentry error tracking (frontend) | ✅ Implemented |
| Audit logging | ✅ Available (not globally applied) |
Configured in src/common/logger/logger.module.ts:
pino-prettyauthorization, cookie, password fields// Usage in services
import { Logger } from '@nestjs/common';
@Injectable()
export class MyService {
private readonly logger = new Logger(MyService.name);
async doWork() {
this.logger.log('Processing started');
this.logger.warn('Slow operation detected');
this.logger.error('Operation failed', error.stack);
}
}
Global interceptor in src/common/interceptors/logging.interceptor.ts:
Server-Timing header to responses// app.module.ts
CacheModule.register({
ttl: 60000, // 60s default TTL
max: 100, // Max 100 items in cache
isGlobal: true,
});
@Controller('standings')
@UseInterceptors(CacheInterceptor)
export class StandingsController {
@Get()
@CacheTTL(30000) // 30 seconds
async getStandings(@Query('seasonId') seasonId: string) {}
}
Global guard with 4 named configurations:
| Name | Limit | TTL |
|---|---|---|
default | 100 requests | 60s |
short | 20 requests | 1s |
medium | 50 requests | 10s |
long | 30 requests | 60s |
Override per-endpoint:
@Throttle({ short: { limit: 5, ttl: 60000 } }) // 5/min
@Post('login')
async login() {}
@SkipThrottle() // Bypass entirely
@Get('me')
async getMe() {}
GET /api/health — Public, skip throttle.
Checks:
$queryRaw pingResponse:
{
"status": "ok",
"info": {
"database": { "status": "up" },
"memory_heap": { "status": "up" }
}
}
Configured in main.tsx:
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
tracesSampleRate: 1.0, // 100% in dev
replaysSessionSampleRate: 0.1, // 10%
replaysOnErrorSampleRate: 1.0, // 100% on errors
});
ErrorBoundary component reports errors to Sentry.
AuditLogInterceptor (src/common/interceptors/audit-log.interceptor.ts):
@UseInterceptors(AuditLogInterceptor) selectivelythis.prisma.team.findMany({ select: { id: true, name: true } })skip/take with count() for large tablesinclude for nested relationsPromise.all([findMany(), count()]) for paginated results