@k-msg/analytics 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregators/index.d.ts +5 -0
- package/dist/aggregators/metric.aggregator.d.ts +76 -0
- package/dist/aggregators/time-series.aggregator.d.ts +51 -0
- package/dist/collectors/event.collector.d.ts +86 -0
- package/dist/collectors/index.d.ts +5 -0
- package/dist/collectors/webhook.collector.d.ts +67 -0
- package/dist/index.d.ts +17 -1047
- package/dist/index.js +43 -4456
- package/dist/index.js.map +85 -1
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +85 -0
- package/dist/insights/anomaly.detector.d.ts +81 -0
- package/dist/insights/index.d.ts +5 -0
- package/dist/insights/recommendation.engine.d.ts +131 -0
- package/dist/reports/dashboard.d.ts +143 -0
- package/dist/reports/export.manager.d.ts +104 -0
- package/dist/reports/index.d.ts +5 -0
- package/dist/services/analytics.service.d.ts +66 -0
- package/dist/services/insight.engine.d.ts +44 -0
- package/dist/services/metrics.collector.d.ts +58 -0
- package/dist/services/report.generator.d.ts +61 -0
- package/dist/types/analytics.types.d.ts +164 -0
- package/package.json +18 -13
- package/dist/index.cjs +0 -4497
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1048
package/dist/index.d.ts
CHANGED
|
@@ -1,1048 +1,18 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
|
|
3
|
-
interface AnalyticsConfig {
|
|
4
|
-
enableRealTimeTracking: boolean;
|
|
5
|
-
retentionDays: number;
|
|
6
|
-
aggregationIntervals: ('minute' | 'hour' | 'day' | 'week' | 'month')[];
|
|
7
|
-
enabledMetrics: MetricType[];
|
|
8
|
-
}
|
|
9
|
-
declare enum MetricType {
|
|
10
|
-
MESSAGE_SENT = "message_sent",
|
|
11
|
-
MESSAGE_DELIVERED = "message_delivered",
|
|
12
|
-
MESSAGE_FAILED = "message_failed",
|
|
13
|
-
MESSAGE_CLICKED = "message_clicked",
|
|
14
|
-
TEMPLATE_USAGE = "template_usage",
|
|
15
|
-
PROVIDER_PERFORMANCE = "provider_performance",
|
|
16
|
-
CHANNEL_USAGE = "channel_usage",
|
|
17
|
-
ERROR_RATE = "error_rate",
|
|
18
|
-
DELIVERY_RATE = "delivery_rate",
|
|
19
|
-
CLICK_RATE = "click_rate"
|
|
20
|
-
}
|
|
21
|
-
interface MetricData {
|
|
22
|
-
id: string;
|
|
23
|
-
type: MetricType;
|
|
24
|
-
timestamp: Date;
|
|
25
|
-
value: number;
|
|
26
|
-
dimensions: Record<string, string>;
|
|
27
|
-
metadata?: Record<string, any>;
|
|
28
|
-
}
|
|
29
|
-
interface AggregatedMetric {
|
|
30
|
-
type: MetricType;
|
|
31
|
-
interval: 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
32
|
-
timestamp: Date;
|
|
33
|
-
dimensions: Record<string, string>;
|
|
34
|
-
aggregations: {
|
|
35
|
-
count: number;
|
|
36
|
-
sum: number;
|
|
37
|
-
avg: number;
|
|
38
|
-
min: number;
|
|
39
|
-
max: number;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
interface AnalyticsReport {
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
description?: string;
|
|
46
|
-
dateRange: {
|
|
47
|
-
start: Date;
|
|
48
|
-
end: Date;
|
|
49
|
-
};
|
|
50
|
-
filters: Record<string, any>;
|
|
51
|
-
metrics: ReportMetric[];
|
|
52
|
-
generatedAt: Date;
|
|
53
|
-
format: 'json' | 'csv' | 'pdf';
|
|
54
|
-
}
|
|
55
|
-
interface ReportMetric {
|
|
56
|
-
type: MetricType;
|
|
57
|
-
value: number;
|
|
58
|
-
change?: number;
|
|
59
|
-
trend?: 'up' | 'down' | 'stable';
|
|
60
|
-
breakdown?: Record<string, number>;
|
|
61
|
-
}
|
|
62
|
-
interface InsightData {
|
|
63
|
-
id: string;
|
|
64
|
-
type: 'anomaly' | 'trend' | 'recommendation';
|
|
65
|
-
title: string;
|
|
66
|
-
description: string;
|
|
67
|
-
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
68
|
-
metric: MetricType;
|
|
69
|
-
dimensions: Record<string, string>;
|
|
70
|
-
value: number;
|
|
71
|
-
expectedValue?: number;
|
|
72
|
-
confidence: number;
|
|
73
|
-
actionable: boolean;
|
|
74
|
-
recommendations?: string[];
|
|
75
|
-
detectedAt: Date;
|
|
76
|
-
}
|
|
77
|
-
interface AnalyticsQuery {
|
|
78
|
-
metrics: MetricType[];
|
|
79
|
-
dateRange: {
|
|
80
|
-
start: Date;
|
|
81
|
-
end: Date;
|
|
82
|
-
};
|
|
83
|
-
interval?: 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
84
|
-
filters?: Record<string, any>;
|
|
85
|
-
groupBy?: string[];
|
|
86
|
-
orderBy?: {
|
|
87
|
-
field: string;
|
|
88
|
-
direction: 'asc' | 'desc';
|
|
89
|
-
}[];
|
|
90
|
-
limit?: number;
|
|
91
|
-
offset?: number;
|
|
92
|
-
}
|
|
93
|
-
interface AnalyticsResult {
|
|
94
|
-
query: AnalyticsQuery;
|
|
95
|
-
data: AggregatedMetric[];
|
|
96
|
-
summary: {
|
|
97
|
-
totalRecords: number;
|
|
98
|
-
dateRange: {
|
|
99
|
-
start: Date;
|
|
100
|
-
end: Date;
|
|
101
|
-
};
|
|
102
|
-
executionTime: number;
|
|
103
|
-
};
|
|
104
|
-
insights?: InsightData[];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
declare class AnalyticsService {
|
|
108
|
-
private config;
|
|
109
|
-
private metricsCollector;
|
|
110
|
-
private reportGenerator;
|
|
111
|
-
private insightEngine;
|
|
112
|
-
private metrics;
|
|
113
|
-
private aggregatedMetrics;
|
|
114
|
-
constructor(config: AnalyticsConfig);
|
|
115
|
-
/**
|
|
116
|
-
* 메트릭 데이터 수집
|
|
117
|
-
*/
|
|
118
|
-
collectMetric(metric: MetricData): Promise<void>;
|
|
119
|
-
/**
|
|
120
|
-
* 분석 쿼리 실행
|
|
121
|
-
*/
|
|
122
|
-
query(query: AnalyticsQuery): Promise<AnalyticsResult>;
|
|
123
|
-
/**
|
|
124
|
-
* 실시간 메트릭 스트림
|
|
125
|
-
*/
|
|
126
|
-
streamMetrics(types: MetricType[]): AsyncGenerator<MetricData>;
|
|
127
|
-
/**
|
|
128
|
-
* 대시보드 데이터 조회
|
|
129
|
-
*/
|
|
130
|
-
getDashboardData(timeRange: {
|
|
131
|
-
start: Date;
|
|
132
|
-
end: Date;
|
|
133
|
-
}): Promise<{
|
|
134
|
-
timeRange: {
|
|
135
|
-
start: Date;
|
|
136
|
-
end: Date;
|
|
137
|
-
};
|
|
138
|
-
kpis: {
|
|
139
|
-
totalMessages: number;
|
|
140
|
-
deliveryRate: number;
|
|
141
|
-
errorRate: number;
|
|
142
|
-
clickRate: number;
|
|
143
|
-
};
|
|
144
|
-
metrics: AggregatedMetric[];
|
|
145
|
-
insights: InsightData[] | undefined;
|
|
146
|
-
trends: {};
|
|
147
|
-
}>;
|
|
148
|
-
/**
|
|
149
|
-
* 이상 탐지
|
|
150
|
-
*/
|
|
151
|
-
detectAnomalies(metricType: MetricType, timeRange: {
|
|
152
|
-
start: Date;
|
|
153
|
-
end: Date;
|
|
154
|
-
}): Promise<InsightData[]>;
|
|
155
|
-
private processRealTimeMetric;
|
|
156
|
-
private validateQuery;
|
|
157
|
-
private executeQuery;
|
|
158
|
-
private performAggregation;
|
|
159
|
-
private generateInsights;
|
|
160
|
-
private getOptimalInterval;
|
|
161
|
-
private calculateKPIs;
|
|
162
|
-
private calculateTrends;
|
|
163
|
-
private sumMetrics;
|
|
164
|
-
private calculateRate;
|
|
165
|
-
private generateCacheKey;
|
|
166
|
-
private startAggregationTasks;
|
|
167
|
-
private scheduleAggregation;
|
|
168
|
-
private getScheduleInterval;
|
|
169
|
-
private runAggregation;
|
|
170
|
-
private notifyAnomalies;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
declare class MetricsCollector {
|
|
174
|
-
private config;
|
|
175
|
-
private buffer;
|
|
176
|
-
private batchSize;
|
|
177
|
-
private flushInterval;
|
|
178
|
-
private storage;
|
|
179
|
-
constructor(config: AnalyticsConfig);
|
|
180
|
-
/**
|
|
181
|
-
* 메트릭 수집
|
|
182
|
-
*/
|
|
183
|
-
collect(metric: MetricData): Promise<void>;
|
|
184
|
-
/**
|
|
185
|
-
* 여러 메트릭 일괄 수집
|
|
186
|
-
*/
|
|
187
|
-
collectBatch(metrics: MetricData[]): Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* 최근 메트릭 조회
|
|
190
|
-
*/
|
|
191
|
-
getRecentMetrics(types: MetricType[], durationMs: number): Promise<MetricData[]>;
|
|
192
|
-
/**
|
|
193
|
-
* 메트릭 통계 조회
|
|
194
|
-
*/
|
|
195
|
-
getMetricStats(type: MetricType, timeRange: {
|
|
196
|
-
start: Date;
|
|
197
|
-
end: Date;
|
|
198
|
-
}): Promise<{
|
|
199
|
-
count: number;
|
|
200
|
-
sum: number;
|
|
201
|
-
avg: number;
|
|
202
|
-
min: number;
|
|
203
|
-
max: number;
|
|
204
|
-
}>;
|
|
205
|
-
/**
|
|
206
|
-
* 메트릭 카운터 증가
|
|
207
|
-
*/
|
|
208
|
-
incrementCounter(type: MetricType, dimensions: Record<string, string>, value?: number): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* 메트릭 게이지 값 설정
|
|
211
|
-
*/
|
|
212
|
-
setGauge(type: MetricType, dimensions: Record<string, string>, value: number): Promise<void>;
|
|
213
|
-
/**
|
|
214
|
-
* 메트릭 히스토그램 기록
|
|
215
|
-
*/
|
|
216
|
-
recordHistogram(type: MetricType, dimensions: Record<string, string>, value: number): Promise<void>;
|
|
217
|
-
/**
|
|
218
|
-
* 메트릭 버퍼 플러시
|
|
219
|
-
*/
|
|
220
|
-
flush(): Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* 메트릭 정리 (보존 기간 초과)
|
|
223
|
-
*/
|
|
224
|
-
cleanup(): Promise<void>;
|
|
225
|
-
private validateMetric;
|
|
226
|
-
private persistMetrics;
|
|
227
|
-
private startBatchProcessor;
|
|
228
|
-
private generateMetricId;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
declare class ReportGenerator {
|
|
232
|
-
private config;
|
|
233
|
-
constructor(config: AnalyticsConfig);
|
|
234
|
-
/**
|
|
235
|
-
* 일일 요약 보고서 생성
|
|
236
|
-
*/
|
|
237
|
-
generateDailySummary(date: Date): Promise<AnalyticsReport>;
|
|
238
|
-
/**
|
|
239
|
-
* 주간 보고서 생성
|
|
240
|
-
*/
|
|
241
|
-
generateWeeklyReport(weekStartDate: Date): Promise<AnalyticsReport>;
|
|
242
|
-
/**
|
|
243
|
-
* 월간 보고서 생성
|
|
244
|
-
*/
|
|
245
|
-
generateMonthlyReport(year: number, month: number): Promise<AnalyticsReport>;
|
|
246
|
-
/**
|
|
247
|
-
* 프로바이더별 성능 보고서
|
|
248
|
-
*/
|
|
249
|
-
generateProviderReport(providerId: string, dateRange: {
|
|
250
|
-
start: Date;
|
|
251
|
-
end: Date;
|
|
252
|
-
}): Promise<AnalyticsReport>;
|
|
253
|
-
/**
|
|
254
|
-
* 템플릿 사용량 보고서
|
|
255
|
-
*/
|
|
256
|
-
generateTemplateUsageReport(dateRange: {
|
|
257
|
-
start: Date;
|
|
258
|
-
end: Date;
|
|
259
|
-
}): Promise<AnalyticsReport>;
|
|
260
|
-
/**
|
|
261
|
-
* 커스텀 보고서 생성
|
|
262
|
-
*/
|
|
263
|
-
generateCustomReport(name: string, dateRange: {
|
|
264
|
-
start: Date;
|
|
265
|
-
end: Date;
|
|
266
|
-
}, filters: Record<string, any>, metricTypes: MetricType[]): Promise<AnalyticsReport>;
|
|
267
|
-
/**
|
|
268
|
-
* 보고서를 CSV 형식으로 내보내기
|
|
269
|
-
*/
|
|
270
|
-
exportToCSV(report: AnalyticsReport): Promise<string>;
|
|
271
|
-
/**
|
|
272
|
-
* 보고서를 JSON 형식으로 내보내기
|
|
273
|
-
*/
|
|
274
|
-
exportToJSON(report: AnalyticsReport): Promise<string>;
|
|
275
|
-
private generateReport;
|
|
276
|
-
private calculateDailyMetrics;
|
|
277
|
-
private calculateWeeklyMetrics;
|
|
278
|
-
private calculateMonthlyMetrics;
|
|
279
|
-
private calculateProviderMetrics;
|
|
280
|
-
private calculateTemplateMetrics;
|
|
281
|
-
private calculateCustomMetrics;
|
|
282
|
-
private getMetricValue;
|
|
283
|
-
private getProviderPerformance;
|
|
284
|
-
private getTemplateUsage;
|
|
285
|
-
private calculateChange;
|
|
286
|
-
private calculateTrend;
|
|
287
|
-
private getMetricPriority;
|
|
288
|
-
private validateReport;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
declare class InsightEngine {
|
|
292
|
-
private config;
|
|
293
|
-
private anomalyThresholds;
|
|
294
|
-
private historicalData;
|
|
295
|
-
constructor(config: AnalyticsConfig);
|
|
296
|
-
/**
|
|
297
|
-
* 실시간 이상 탐지
|
|
298
|
-
*/
|
|
299
|
-
detectRealTimeAnomalies(metric: MetricData): Promise<InsightData[]>;
|
|
300
|
-
/**
|
|
301
|
-
* 시계열 이상 탐지
|
|
302
|
-
*/
|
|
303
|
-
detectAnomalies(metricType: MetricType, timeRange: {
|
|
304
|
-
start: Date;
|
|
305
|
-
end: Date;
|
|
306
|
-
}): Promise<InsightData[]>;
|
|
307
|
-
/**
|
|
308
|
-
* 인사이트 생성
|
|
309
|
-
*/
|
|
310
|
-
generateInsights(query: AnalyticsQuery, data: AggregatedMetric[]): Promise<InsightData[]>;
|
|
311
|
-
/**
|
|
312
|
-
* 트렌드 예측
|
|
313
|
-
*/
|
|
314
|
-
predictTrends(metricType: MetricType, forecastDays: number): Promise<{
|
|
315
|
-
date: Date;
|
|
316
|
-
predicted: number;
|
|
317
|
-
confidence: number;
|
|
318
|
-
}[]>;
|
|
319
|
-
private initializeBaselines;
|
|
320
|
-
private detectTrendChange;
|
|
321
|
-
private detectSeasonalAnomalies;
|
|
322
|
-
private detectPatternAnomalies;
|
|
323
|
-
private detectThresholdAnomalies;
|
|
324
|
-
private generatePerformanceInsights;
|
|
325
|
-
private generateTrendInsights;
|
|
326
|
-
private generateComparisonInsights;
|
|
327
|
-
private generateRecommendationInsights;
|
|
328
|
-
private calculateSeverity;
|
|
329
|
-
private calculateConfidence;
|
|
330
|
-
private generateRecommendations;
|
|
331
|
-
private calculateTrend;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
1
|
/**
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*/
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* 시계열 데이터를 지정된 간격으로 집계
|
|
354
|
-
*/
|
|
355
|
-
aggregate(metrics: MetricData[], interval: 'minute' | 'hour' | 'day' | 'week' | 'month', options?: AggregationOptions): Promise<AggregatedMetric[]>;
|
|
356
|
-
/**
|
|
357
|
-
* 롤링 윈도우 집계
|
|
358
|
-
*/
|
|
359
|
-
aggregateRolling(metrics: MetricData[], windowSize: number, // 분 단위
|
|
360
|
-
step?: number): Promise<AggregatedMetric[]>;
|
|
361
|
-
/**
|
|
362
|
-
* 계절성 분해 (간단한 이동평균 기반)
|
|
363
|
-
*/
|
|
364
|
-
decomposeSeasonality(metrics: AggregatedMetric[], seasonLength?: number): Promise<{
|
|
365
|
-
trend: AggregatedMetric[];
|
|
366
|
-
seasonal: AggregatedMetric[];
|
|
367
|
-
residual: AggregatedMetric[];
|
|
368
|
-
}>;
|
|
369
|
-
/**
|
|
370
|
-
* 다운샘플링 (고해상도 → 저해상도)
|
|
371
|
-
*/
|
|
372
|
-
downsample(metrics: AggregatedMetric[], targetInterval: 'minute' | 'hour' | 'day' | 'week' | 'month'): Promise<AggregatedMetric[]>;
|
|
373
|
-
private groupByType;
|
|
374
|
-
private groupByDimensions;
|
|
375
|
-
private aggregateByInterval;
|
|
376
|
-
private groupByTimeInterval;
|
|
377
|
-
private getTimeIntervalKey;
|
|
378
|
-
private fillTimeGaps;
|
|
379
|
-
private calculateAggregations;
|
|
380
|
-
private aggregateWindow;
|
|
381
|
-
private calculateMovingAverage;
|
|
382
|
-
private calculateSeasonalComponent;
|
|
383
|
-
private calculateResidual;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Metric Aggregator
|
|
388
|
-
* 메트릭별 특화 집계 로직
|
|
389
|
-
*/
|
|
390
|
-
|
|
391
|
-
interface AggregationRule {
|
|
392
|
-
metricType: MetricType;
|
|
393
|
-
aggregationType: 'sum' | 'avg' | 'min' | 'max' | 'count' | 'rate' | 'percentile';
|
|
394
|
-
dimensions: string[];
|
|
395
|
-
conditions?: Array<{
|
|
396
|
-
field: string;
|
|
397
|
-
operator: 'equals' | 'not_equals' | 'gt' | 'lt' | 'contains';
|
|
398
|
-
value: any;
|
|
399
|
-
}>;
|
|
400
|
-
percentile?: number;
|
|
401
|
-
}
|
|
402
|
-
interface AggregatorConfig {
|
|
403
|
-
rules: AggregationRule[];
|
|
404
|
-
batchSize: number;
|
|
405
|
-
flushInterval: number;
|
|
406
|
-
}
|
|
407
|
-
declare class MetricAggregator {
|
|
408
|
-
private config;
|
|
409
|
-
private buffer;
|
|
410
|
-
private aggregationCache;
|
|
411
|
-
constructor(config: AggregatorConfig);
|
|
412
|
-
/**
|
|
413
|
-
* 메트릭 추가 및 실시간 집계
|
|
414
|
-
*/
|
|
415
|
-
addMetric(metric: MetricData): Promise<void>;
|
|
416
|
-
/**
|
|
417
|
-
* 배치 메트릭 처리
|
|
418
|
-
*/
|
|
419
|
-
addMetrics(metrics: MetricData[]): Promise<void>;
|
|
420
|
-
/**
|
|
421
|
-
* 규칙 기반 집계 실행
|
|
422
|
-
*/
|
|
423
|
-
aggregateByRules(metrics: MetricData[]): Promise<AggregatedMetric[]>;
|
|
424
|
-
/**
|
|
425
|
-
* 커스텀 집계 (동적 규칙)
|
|
426
|
-
*/
|
|
427
|
-
aggregateCustom(metrics: MetricData[], groupBy: string[], aggregationType: 'sum' | 'avg' | 'min' | 'max' | 'count' | 'rate', filters?: Record<string, any>): Promise<AggregatedMetric[]>;
|
|
428
|
-
/**
|
|
429
|
-
* 비율 계산 (예: 전환율, 오류율)
|
|
430
|
-
*/
|
|
431
|
-
calculateRates(numeratorMetrics: MetricData[], denominatorMetrics: MetricData[], groupBy?: string[]): Promise<AggregatedMetric[]>;
|
|
432
|
-
/**
|
|
433
|
-
* 백분위수 계산
|
|
434
|
-
*/
|
|
435
|
-
calculatePercentiles(metrics: MetricData[], percentiles: number[], groupBy?: string[]): Promise<AggregatedMetric[]>;
|
|
436
|
-
/**
|
|
437
|
-
* 슬라이딩 윈도우 집계
|
|
438
|
-
*/
|
|
439
|
-
aggregateSlidingWindow(metrics: MetricData[], windowSizeMs: number, stepMs: number, aggregationType: 'sum' | 'avg' | 'min' | 'max' | 'count'): Promise<AggregatedMetric[]>;
|
|
440
|
-
/**
|
|
441
|
-
* 메트릭 정규화
|
|
442
|
-
*/
|
|
443
|
-
normalizeMetrics(metrics: AggregatedMetric[], method: 'minmax' | 'zscore' | 'robust'): Promise<AggregatedMetric[]>;
|
|
444
|
-
private getBufferKey;
|
|
445
|
-
private flushBuffer;
|
|
446
|
-
private filterMetricsByRule;
|
|
447
|
-
private applyAggregationRule;
|
|
448
|
-
private groupMetrics;
|
|
449
|
-
private createGroupKey;
|
|
450
|
-
private getFieldValue;
|
|
451
|
-
private evaluateCondition;
|
|
452
|
-
private performAggregation;
|
|
453
|
-
private applyFilters;
|
|
454
|
-
private calculatePercentile;
|
|
455
|
-
private minMaxNormalize;
|
|
456
|
-
private zScoreNormalize;
|
|
457
|
-
private robustNormalize;
|
|
458
|
-
private calculateMAD;
|
|
459
|
-
private startPeriodicFlush;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Event Collector
|
|
464
|
-
* 실시간 이벤트 수집 및 메트릭 변환
|
|
465
|
-
*/
|
|
466
|
-
|
|
467
|
-
interface EventData {
|
|
468
|
-
id: string;
|
|
469
|
-
type: string;
|
|
470
|
-
timestamp: Date;
|
|
471
|
-
source: string;
|
|
472
|
-
payload: Record<string, any>;
|
|
473
|
-
context?: {
|
|
474
|
-
userId?: string;
|
|
475
|
-
sessionId?: string;
|
|
476
|
-
requestId?: string;
|
|
477
|
-
userAgent?: string;
|
|
478
|
-
ipAddress?: string;
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
interface EventCollectorConfig {
|
|
482
|
-
bufferSize: number;
|
|
483
|
-
flushInterval: number;
|
|
484
|
-
enableDeduplication: boolean;
|
|
485
|
-
deduplicationWindow: number;
|
|
486
|
-
enableSampling: boolean;
|
|
487
|
-
samplingRate: number;
|
|
488
|
-
}
|
|
489
|
-
interface EventProcessor {
|
|
490
|
-
canProcess(event: EventData): boolean;
|
|
491
|
-
process(event: EventData): Promise<MetricData[]>;
|
|
492
|
-
}
|
|
493
|
-
declare class EventCollector extends EventEmitter {
|
|
494
|
-
private config;
|
|
495
|
-
private buffer;
|
|
496
|
-
private processors;
|
|
497
|
-
private recentEvents;
|
|
498
|
-
private metrics;
|
|
499
|
-
private defaultConfig;
|
|
500
|
-
constructor(config?: Partial<EventCollectorConfig>);
|
|
501
|
-
/**
|
|
502
|
-
* 이벤트 수집
|
|
503
|
-
*/
|
|
504
|
-
collectEvent(event: EventData): Promise<void>;
|
|
505
|
-
/**
|
|
506
|
-
* 배치 이벤트 수집
|
|
507
|
-
*/
|
|
508
|
-
collectEvents(events: EventData[]): Promise<void>;
|
|
509
|
-
/**
|
|
510
|
-
* 커스텀 이벤트 프로세서 등록
|
|
511
|
-
*/
|
|
512
|
-
registerProcessor(name: string, processor: EventProcessor): void;
|
|
513
|
-
/**
|
|
514
|
-
* 이벤트 프로세서 제거
|
|
515
|
-
*/
|
|
516
|
-
unregisterProcessor(name: string): boolean;
|
|
517
|
-
/**
|
|
518
|
-
* 수집된 메트릭 조회
|
|
519
|
-
*/
|
|
520
|
-
getCollectedMetrics(since?: Date): MetricData[];
|
|
521
|
-
/**
|
|
522
|
-
* 실시간 메트릭 스트림
|
|
523
|
-
*/
|
|
524
|
-
streamMetrics(): AsyncGenerator<MetricData[]>;
|
|
525
|
-
/**
|
|
526
|
-
* 이벤트 통계
|
|
527
|
-
*/
|
|
528
|
-
getEventStats(): {
|
|
529
|
-
totalEvents: number;
|
|
530
|
-
eventsByType: Record<string, number>;
|
|
531
|
-
eventsBySource: Record<string, number>;
|
|
532
|
-
bufferSize: number;
|
|
533
|
-
metricsGenerated: number;
|
|
534
|
-
};
|
|
535
|
-
/**
|
|
536
|
-
* 버퍼 강제 플러시
|
|
537
|
-
*/
|
|
538
|
-
flush(): Promise<void>;
|
|
539
|
-
private processEvent;
|
|
540
|
-
private validateEvent;
|
|
541
|
-
private isDuplicate;
|
|
542
|
-
private isHighPriorityEvent;
|
|
543
|
-
private initializeDefaultProcessors;
|
|
544
|
-
private startPeriodicFlush;
|
|
545
|
-
private startCleanup;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Webhook Collector
|
|
550
|
-
* 웹훅을 통한 외부 이벤트 수집
|
|
551
|
-
*/
|
|
552
|
-
|
|
553
|
-
interface WebhookData {
|
|
554
|
-
id: string;
|
|
555
|
-
source: string;
|
|
556
|
-
timestamp: Date;
|
|
557
|
-
headers: Record<string, string>;
|
|
558
|
-
body: any;
|
|
559
|
-
signature?: string;
|
|
560
|
-
}
|
|
561
|
-
interface WebhookCollectorConfig {
|
|
562
|
-
enableSignatureValidation: boolean;
|
|
563
|
-
signatureHeader: string;
|
|
564
|
-
secretKey?: string;
|
|
565
|
-
allowedSources: string[];
|
|
566
|
-
maxPayloadSize: number;
|
|
567
|
-
rateLimitPerMinute: number;
|
|
568
|
-
}
|
|
569
|
-
interface WebhookTransformer {
|
|
570
|
-
canTransform(webhook: WebhookData): boolean;
|
|
571
|
-
transform(webhook: WebhookData): Promise<EventData[]>;
|
|
572
|
-
}
|
|
573
|
-
declare class WebhookCollector extends EventEmitter {
|
|
574
|
-
private config;
|
|
575
|
-
private transformers;
|
|
576
|
-
private requestCounts;
|
|
577
|
-
private processedWebhooks;
|
|
578
|
-
private defaultConfig;
|
|
579
|
-
constructor(config?: Partial<WebhookCollectorConfig>);
|
|
580
|
-
/**
|
|
581
|
-
* 웹훅 수신 처리
|
|
582
|
-
*/
|
|
583
|
-
receiveWebhook(webhook: WebhookData): Promise<EventData[]>;
|
|
584
|
-
/**
|
|
585
|
-
* 웹훅 변환기 등록
|
|
586
|
-
*/
|
|
587
|
-
registerTransformer(name: string, transformer: WebhookTransformer): void;
|
|
588
|
-
/**
|
|
589
|
-
* 웹훅 변환기 제거
|
|
590
|
-
*/
|
|
591
|
-
unregisterTransformer(name: string): boolean;
|
|
592
|
-
/**
|
|
593
|
-
* 처리된 웹훅 조회
|
|
594
|
-
*/
|
|
595
|
-
getProcessedWebhooks(since?: Date): WebhookData[];
|
|
596
|
-
/**
|
|
597
|
-
* 웹훅 통계
|
|
598
|
-
*/
|
|
599
|
-
getWebhookStats(): {
|
|
600
|
-
totalProcessed: number;
|
|
601
|
-
bySource: Record<string, number>;
|
|
602
|
-
recentCount: number;
|
|
603
|
-
transformerCount: number;
|
|
604
|
-
};
|
|
605
|
-
private validateWebhook;
|
|
606
|
-
private validateSignature;
|
|
607
|
-
private generateSignature;
|
|
608
|
-
private checkRateLimit;
|
|
609
|
-
private transformWebhook;
|
|
610
|
-
private defaultTransform;
|
|
611
|
-
private initializeDefaultTransformers;
|
|
612
|
-
private startCleanup;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Anomaly Detector
|
|
617
|
-
* 이상 징후 탐지 및 분석
|
|
618
|
-
*/
|
|
619
|
-
|
|
620
|
-
interface AnomalyDetectionConfig {
|
|
621
|
-
algorithms: AnomalyAlgorithm[];
|
|
622
|
-
sensitivity: 'low' | 'medium' | 'high';
|
|
623
|
-
minDataPoints: number;
|
|
624
|
-
confidenceThreshold: number;
|
|
625
|
-
enableSeasonalAdjustment: boolean;
|
|
626
|
-
}
|
|
627
|
-
interface AnomalyAlgorithm {
|
|
628
|
-
name: string;
|
|
629
|
-
type: 'statistical' | 'ml' | 'rule-based';
|
|
630
|
-
enabled: boolean;
|
|
631
|
-
config: Record<string, any>;
|
|
632
|
-
}
|
|
633
|
-
interface Anomaly {
|
|
634
|
-
id: string;
|
|
635
|
-
metricType: MetricType;
|
|
636
|
-
timestamp: Date;
|
|
637
|
-
value: number;
|
|
638
|
-
expectedValue: number;
|
|
639
|
-
deviation: number;
|
|
640
|
-
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
641
|
-
confidence: number;
|
|
642
|
-
algorithm: string;
|
|
643
|
-
dimensions: Record<string, string>;
|
|
644
|
-
context?: {
|
|
645
|
-
trend: 'increasing' | 'decreasing' | 'stable';
|
|
646
|
-
seasonality: boolean;
|
|
647
|
-
historicalComparison: number;
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
declare class AnomalyDetector {
|
|
651
|
-
private config;
|
|
652
|
-
private historicalData;
|
|
653
|
-
private seasonalPatterns;
|
|
654
|
-
private baselines;
|
|
655
|
-
private defaultConfig;
|
|
656
|
-
constructor(config?: Partial<AnomalyDetectionConfig>);
|
|
657
|
-
/**
|
|
658
|
-
* 실시간 이상 탐지
|
|
659
|
-
*/
|
|
660
|
-
detectRealTimeAnomalies(metric: MetricData): Promise<Anomaly[]>;
|
|
661
|
-
/**
|
|
662
|
-
* 배치 이상 탐지
|
|
663
|
-
*/
|
|
664
|
-
detectBatchAnomalies(metrics: AggregatedMetric[], timeWindow?: {
|
|
665
|
-
start: Date;
|
|
666
|
-
end: Date;
|
|
667
|
-
}): Promise<Anomaly[]>;
|
|
668
|
-
/**
|
|
669
|
-
* 트렌드 변화 탐지
|
|
670
|
-
*/
|
|
671
|
-
detectTrendChanges(metrics: AggregatedMetric[], windowSize?: number): Promise<InsightData[]>;
|
|
672
|
-
/**
|
|
673
|
-
* 베이스라인 업데이트
|
|
674
|
-
*/
|
|
675
|
-
updateBaselines(metrics: AggregatedMetric[]): Promise<void>;
|
|
676
|
-
private runAlgorithm;
|
|
677
|
-
private zScoreDetection;
|
|
678
|
-
private iqrDetection;
|
|
679
|
-
private isolationForestDetection;
|
|
680
|
-
private thresholdDetection;
|
|
681
|
-
private calculateSeverity;
|
|
682
|
-
private calculateTrendSeverity;
|
|
683
|
-
private getMetricKey;
|
|
684
|
-
private updateHistoricalData;
|
|
685
|
-
private groupMetricsByTypeAndDimensions;
|
|
686
|
-
private adjustForSeasonality;
|
|
687
|
-
private calculateTrend;
|
|
688
|
-
private detectTrend;
|
|
689
|
-
private getSensitivityThreshold;
|
|
690
|
-
private calculateIsolationThreshold;
|
|
691
|
-
private calculateIsolationScore;
|
|
692
|
-
private deduplicateAndRankAnomalies;
|
|
693
|
-
private generateTrendRecommendations;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* Recommendation Engine
|
|
698
|
-
* 데이터 기반 추천 시스템
|
|
699
|
-
*/
|
|
700
|
-
|
|
701
|
-
interface RecommendationConfig {
|
|
702
|
-
rules: RecommendationRule[];
|
|
703
|
-
enableMachineLearning: boolean;
|
|
704
|
-
confidenceThreshold: number;
|
|
705
|
-
maxRecommendations: number;
|
|
706
|
-
categories: RecommendationCategory[];
|
|
707
|
-
}
|
|
708
|
-
interface RecommendationRule {
|
|
709
|
-
id: string;
|
|
710
|
-
name: string;
|
|
711
|
-
category: string;
|
|
712
|
-
priority: number;
|
|
713
|
-
conditions: RuleCondition[];
|
|
714
|
-
actions: RecommendationAction[];
|
|
715
|
-
enabled: boolean;
|
|
716
|
-
}
|
|
717
|
-
interface RuleCondition {
|
|
718
|
-
metric: MetricType;
|
|
719
|
-
operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte' | 'between' | 'trend';
|
|
720
|
-
value: number | [number, number];
|
|
721
|
-
timeWindow?: string;
|
|
722
|
-
dimensions?: Record<string, string>;
|
|
723
|
-
}
|
|
724
|
-
interface RecommendationAction {
|
|
725
|
-
type: 'optimization' | 'cost-saving' | 'performance' | 'reliability' | 'security';
|
|
726
|
-
title: string;
|
|
727
|
-
description: string;
|
|
728
|
-
impact: 'low' | 'medium' | 'high';
|
|
729
|
-
effort: 'low' | 'medium' | 'high';
|
|
730
|
-
steps: string[];
|
|
731
|
-
estimatedBenefit?: {
|
|
732
|
-
metric: MetricType;
|
|
733
|
-
improvement: number;
|
|
734
|
-
unit: string;
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
interface Recommendation {
|
|
738
|
-
id: string;
|
|
739
|
-
category: string;
|
|
740
|
-
priority: number;
|
|
741
|
-
title: string;
|
|
742
|
-
description: string;
|
|
743
|
-
rationale: string;
|
|
744
|
-
actions: RecommendationAction[];
|
|
745
|
-
confidence: number;
|
|
746
|
-
impact: 'low' | 'medium' | 'high';
|
|
747
|
-
effort: 'low' | 'medium' | 'high';
|
|
748
|
-
createdAt: Date;
|
|
749
|
-
validUntil?: Date;
|
|
750
|
-
metadata: {
|
|
751
|
-
ruleIds: string[];
|
|
752
|
-
triggeredBy: {
|
|
753
|
-
metrics: {
|
|
754
|
-
type: MetricType;
|
|
755
|
-
value: number;
|
|
756
|
-
timestamp: Date;
|
|
757
|
-
}[];
|
|
758
|
-
conditions: string[];
|
|
759
|
-
};
|
|
760
|
-
estimatedROI?: number;
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
interface RecommendationCategory {
|
|
764
|
-
id: string;
|
|
765
|
-
name: string;
|
|
766
|
-
description: string;
|
|
767
|
-
weight: number;
|
|
768
|
-
}
|
|
769
|
-
declare class RecommendationEngine {
|
|
770
|
-
private config;
|
|
771
|
-
private recommendations;
|
|
772
|
-
private ruleExecutionHistory;
|
|
773
|
-
private defaultConfig;
|
|
774
|
-
constructor(config?: Partial<RecommendationConfig>);
|
|
775
|
-
/**
|
|
776
|
-
* 메트릭 기반 추천 생성
|
|
777
|
-
*/
|
|
778
|
-
generateRecommendations(metrics: AggregatedMetric[]): Promise<Recommendation[]>;
|
|
779
|
-
/**
|
|
780
|
-
* 특정 카테고리 추천 조회
|
|
781
|
-
*/
|
|
782
|
-
getRecommendationsByCategory(category: string): Recommendation[];
|
|
783
|
-
/**
|
|
784
|
-
* 추천 실행 상태 업데이트
|
|
785
|
-
*/
|
|
786
|
-
markRecommendationAsImplemented(recommendationId: string): boolean;
|
|
787
|
-
/**
|
|
788
|
-
* 추천 무시
|
|
789
|
-
*/
|
|
790
|
-
dismissRecommendation(recommendationId: string, reason?: string): boolean;
|
|
791
|
-
/**
|
|
792
|
-
* 추천 통계
|
|
793
|
-
*/
|
|
794
|
-
getRecommendationStats(): {
|
|
795
|
-
total: number;
|
|
796
|
-
byCategory: Record<string, number>;
|
|
797
|
-
byImpact: Record<string, number>;
|
|
798
|
-
byPriority: Record<string, number>;
|
|
799
|
-
};
|
|
800
|
-
private generateRuleBasedRecommendations;
|
|
801
|
-
private generatePatternBasedRecommendations;
|
|
802
|
-
private generateComparisonBasedRecommendations;
|
|
803
|
-
private generateMLBasedRecommendations;
|
|
804
|
-
private evaluateRuleConditions;
|
|
805
|
-
private evaluateCondition;
|
|
806
|
-
private createRecommendationFromRule;
|
|
807
|
-
private analyzeTimePatterns;
|
|
808
|
-
private generateTimeBasedRecommendations;
|
|
809
|
-
private analyzeChannelPatterns;
|
|
810
|
-
private generateChannelBasedRecommendations;
|
|
811
|
-
private analyzeErrorPatterns;
|
|
812
|
-
private generateErrorBasedRecommendations;
|
|
813
|
-
private compareProviderPerformance;
|
|
814
|
-
private generateProviderRecommendations;
|
|
815
|
-
private compareChannelEfficiency;
|
|
816
|
-
private generateChannelEfficiencyRecommendations;
|
|
817
|
-
private generateCapacityRecommendations;
|
|
818
|
-
private calculateRuleConfidence;
|
|
819
|
-
private calculateAggregateImpact;
|
|
820
|
-
private calculateAggregateEffort;
|
|
821
|
-
private generateRationale;
|
|
822
|
-
private recordRuleExecution;
|
|
823
|
-
private deduplicateAndPrioritize;
|
|
824
|
-
private initializeDefaultRules;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* Dashboard Report Generator
|
|
829
|
-
* 실시간 대시보드 데이터 생성
|
|
830
|
-
*/
|
|
831
|
-
|
|
832
|
-
interface DashboardConfig {
|
|
833
|
-
refreshInterval: number;
|
|
834
|
-
timeRange: {
|
|
835
|
-
default: string;
|
|
836
|
-
options: string[];
|
|
837
|
-
};
|
|
838
|
-
widgets: DashboardWidget[];
|
|
839
|
-
filters: DashboardFilter[];
|
|
840
|
-
}
|
|
841
|
-
interface DashboardWidget {
|
|
842
|
-
id: string;
|
|
843
|
-
type: 'metric' | 'chart' | 'table' | 'gauge' | 'heatmap' | 'trend';
|
|
844
|
-
title: string;
|
|
845
|
-
description?: string;
|
|
846
|
-
position: {
|
|
847
|
-
x: number;
|
|
848
|
-
y: number;
|
|
849
|
-
width: number;
|
|
850
|
-
height: number;
|
|
851
|
-
};
|
|
852
|
-
query: AnalyticsQuery;
|
|
853
|
-
visualization: VisualizationConfig;
|
|
854
|
-
refreshInterval?: number;
|
|
855
|
-
}
|
|
856
|
-
interface VisualizationConfig {
|
|
857
|
-
chartType?: 'line' | 'bar' | 'pie' | 'area' | 'scatter';
|
|
858
|
-
aggregation?: 'sum' | 'avg' | 'min' | 'max' | 'count';
|
|
859
|
-
groupBy?: string[];
|
|
860
|
-
colors?: string[];
|
|
861
|
-
yAxis?: {
|
|
862
|
-
min?: number;
|
|
863
|
-
max?: number;
|
|
864
|
-
label?: string;
|
|
865
|
-
};
|
|
866
|
-
xAxis?: {
|
|
867
|
-
label?: string;
|
|
868
|
-
};
|
|
869
|
-
showLegend?: boolean;
|
|
870
|
-
showGrid?: boolean;
|
|
871
|
-
}
|
|
872
|
-
interface DashboardFilter {
|
|
873
|
-
id: string;
|
|
874
|
-
name: string;
|
|
875
|
-
type: 'select' | 'date' | 'range' | 'multi-select';
|
|
876
|
-
field: string;
|
|
877
|
-
options?: Array<{
|
|
878
|
-
value: string;
|
|
879
|
-
label: string;
|
|
880
|
-
}>;
|
|
881
|
-
defaultValue?: any;
|
|
882
|
-
}
|
|
883
|
-
interface DashboardData {
|
|
884
|
-
timestamp: Date;
|
|
885
|
-
timeRange: {
|
|
886
|
-
start: Date;
|
|
887
|
-
end: Date;
|
|
888
|
-
};
|
|
889
|
-
kpis: KPIData[];
|
|
890
|
-
widgets: WidgetData[];
|
|
891
|
-
insights: InsightData[];
|
|
892
|
-
filters: Record<string, any>;
|
|
893
|
-
}
|
|
894
|
-
interface KPIData {
|
|
895
|
-
id: string;
|
|
896
|
-
name: string;
|
|
897
|
-
value: number;
|
|
898
|
-
previousValue?: number;
|
|
899
|
-
change?: number;
|
|
900
|
-
changePercent?: number;
|
|
901
|
-
trend: 'up' | 'down' | 'stable';
|
|
902
|
-
unit?: string;
|
|
903
|
-
target?: number;
|
|
904
|
-
status: 'good' | 'warning' | 'critical';
|
|
905
|
-
}
|
|
906
|
-
interface WidgetData {
|
|
907
|
-
id: string;
|
|
908
|
-
title: string;
|
|
909
|
-
type: string;
|
|
910
|
-
data: any;
|
|
911
|
-
lastUpdated: Date;
|
|
912
|
-
error?: string;
|
|
913
|
-
}
|
|
914
|
-
declare class DashboardGenerator {
|
|
915
|
-
private config;
|
|
916
|
-
private dataCache;
|
|
917
|
-
private defaultConfig;
|
|
918
|
-
constructor(config?: Partial<DashboardConfig>);
|
|
919
|
-
/**
|
|
920
|
-
* 대시보드 데이터 생성
|
|
921
|
-
*/
|
|
922
|
-
generateDashboard(timeRange: {
|
|
923
|
-
start: Date;
|
|
924
|
-
end: Date;
|
|
925
|
-
}, filters?: Record<string, any>, metrics?: AggregatedMetric[]): Promise<DashboardData>;
|
|
926
|
-
/**
|
|
927
|
-
* 실시간 대시보드 스트림
|
|
928
|
-
*/
|
|
929
|
-
streamDashboard(timeRange: {
|
|
930
|
-
start: Date;
|
|
931
|
-
end: Date;
|
|
932
|
-
}, filters?: Record<string, any>): AsyncGenerator<DashboardData>;
|
|
933
|
-
/**
|
|
934
|
-
* 특정 위젯 데이터 업데이트
|
|
935
|
-
*/
|
|
936
|
-
updateWidget(widgetId: string, metrics: AggregatedMetric[], timeRange: {
|
|
937
|
-
start: Date;
|
|
938
|
-
end: Date;
|
|
939
|
-
}, filters?: Record<string, any>): Promise<WidgetData | null>;
|
|
940
|
-
/**
|
|
941
|
-
* 대시보드 구성 업데이트
|
|
942
|
-
*/
|
|
943
|
-
updateConfig(config: Partial<DashboardConfig>): void;
|
|
944
|
-
/**
|
|
945
|
-
* 위젯 추가
|
|
946
|
-
*/
|
|
947
|
-
addWidget(widget: DashboardWidget): void;
|
|
948
|
-
/**
|
|
949
|
-
* 위젯 제거
|
|
950
|
-
*/
|
|
951
|
-
removeWidget(widgetId: string): boolean;
|
|
952
|
-
private calculateKPIs;
|
|
953
|
-
private generateWidgetData;
|
|
954
|
-
private generateSingleWidgetData;
|
|
955
|
-
private generateMetricWidgetData;
|
|
956
|
-
private generateChartWidgetData;
|
|
957
|
-
private generateGroupedChartData;
|
|
958
|
-
private generateTableWidgetData;
|
|
959
|
-
private generateGaugeWidgetData;
|
|
960
|
-
private generateHeatmapWidgetData;
|
|
961
|
-
private generateTrendWidgetData;
|
|
962
|
-
private filterMetrics;
|
|
963
|
-
private applyQueryFilters;
|
|
964
|
-
private calculatePreviousPeriodValue;
|
|
965
|
-
private getAggregatedValue;
|
|
966
|
-
private formatValue;
|
|
967
|
-
private getDefaultColor;
|
|
968
|
-
private initializeDefaultWidgets;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
/**
|
|
972
|
-
* Export Manager
|
|
973
|
-
* 다양한 형식으로 데이터 내보내기
|
|
974
|
-
*/
|
|
975
|
-
|
|
976
|
-
interface ExportConfig {
|
|
977
|
-
formats: ExportFormat[];
|
|
978
|
-
maxFileSize: number;
|
|
979
|
-
compressionEnabled: boolean;
|
|
980
|
-
watermark?: {
|
|
981
|
-
text: string;
|
|
982
|
-
position: 'top' | 'bottom';
|
|
983
|
-
};
|
|
984
|
-
scheduling?: {
|
|
985
|
-
enabled: boolean;
|
|
986
|
-
cron: string;
|
|
987
|
-
recipients: string[];
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
interface ExportFormat {
|
|
991
|
-
type: 'csv' | 'excel' | 'pdf' | 'json' | 'xml';
|
|
992
|
-
options?: Record<string, any>;
|
|
993
|
-
template?: string;
|
|
994
|
-
}
|
|
995
|
-
interface ExportResult {
|
|
996
|
-
id: string;
|
|
997
|
-
format: string;
|
|
998
|
-
fileName: string;
|
|
999
|
-
filePath: string;
|
|
1000
|
-
fileSize: number;
|
|
1001
|
-
createdAt: Date;
|
|
1002
|
-
downloadUrl?: string;
|
|
1003
|
-
expiresAt?: Date;
|
|
1004
|
-
}
|
|
1005
|
-
declare class ExportManager {
|
|
1006
|
-
private config;
|
|
1007
|
-
private exports;
|
|
1008
|
-
private exportQueue;
|
|
1009
|
-
private defaultConfig;
|
|
1010
|
-
constructor(config?: Partial<ExportConfig>);
|
|
1011
|
-
/**
|
|
1012
|
-
* 분석 보고서 내보내기
|
|
1013
|
-
*/
|
|
1014
|
-
exportReport(report: AnalyticsReport, format: ExportFormat, options?: any): Promise<ExportResult>;
|
|
1015
|
-
/**
|
|
1016
|
-
* 메트릭 데이터 내보내기
|
|
1017
|
-
*/
|
|
1018
|
-
exportMetrics(metrics: AggregatedMetric[], format: ExportFormat, options?: any): Promise<ExportResult>;
|
|
1019
|
-
/**
|
|
1020
|
-
* 인사이트 데이터 내보내기
|
|
1021
|
-
*/
|
|
1022
|
-
exportInsights(insights: InsightData[], format: ExportFormat, options?: any): Promise<ExportResult>;
|
|
1023
|
-
/**
|
|
1024
|
-
* 내보내기 상태 조회
|
|
1025
|
-
*/
|
|
1026
|
-
getExportStatus(exportId: string): ExportResult | null;
|
|
1027
|
-
/**
|
|
1028
|
-
* 내보내기 목록 조회
|
|
1029
|
-
*/
|
|
1030
|
-
listExports(limit?: number): ExportResult[];
|
|
1031
|
-
/**
|
|
1032
|
-
* 내보내기 삭제
|
|
1033
|
-
*/
|
|
1034
|
-
deleteExport(exportId: string): boolean;
|
|
1035
|
-
private exportToCSV;
|
|
1036
|
-
private exportToExcel;
|
|
1037
|
-
private exportToPDF;
|
|
1038
|
-
private exportToJSON;
|
|
1039
|
-
private exportToXML;
|
|
1040
|
-
private exportMetricsToCSV;
|
|
1041
|
-
private exportMetricsToJSON;
|
|
1042
|
-
private exportInsightsToCSV;
|
|
1043
|
-
private exportInsightsToJSON;
|
|
1044
|
-
private exportInsightsToPDF;
|
|
1045
|
-
private generateExportId;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
export { type AggregatedMetric, type AggregationOptions, type AggregationRule, type AggregatorConfig, type AnalyticsConfig, type AnalyticsQuery, type AnalyticsReport, type AnalyticsResult, AnalyticsService, type Anomaly, type AnomalyAlgorithm, type AnomalyDetectionConfig, AnomalyDetector, type DashboardConfig, type DashboardData, DashboardGenerator, type DashboardWidget, EventCollector, type EventCollectorConfig, type EventData, type EventProcessor, type ExportConfig, type ExportFormat, ExportManager, type ExportResult, type InsightData, InsightEngine, type KPIData, MetricAggregator, type MetricData, MetricType, MetricsCollector, type Recommendation, type RecommendationConfig, RecommendationEngine, type RecommendationRule, ReportGenerator, type ReportMetric, TimeSeriesAggregator, type TimeWindow, WebhookCollector, type WebhookCollectorConfig, type WebhookData, type WidgetData };
|
|
2
|
+
* Analytics Engine
|
|
3
|
+
* 메시지 전송 통계 및 분석 기능 제공
|
|
4
|
+
*/
|
|
5
|
+
export type { AggregationOptions, AggregationRule, AggregatorConfig, TimeWindow, } from "./aggregators/index";
|
|
6
|
+
export { MetricAggregator, TimeSeriesAggregator } from "./aggregators/index";
|
|
7
|
+
export type { EventCollectorConfig, EventData, EventProcessor, WebhookCollectorConfig, WebhookData, } from "./collectors/index";
|
|
8
|
+
export { EventCollector, WebhookCollector } from "./collectors/index";
|
|
9
|
+
export type { Anomaly, AnomalyAlgorithm, AnomalyDetectionConfig, Recommendation, RecommendationConfig, RecommendationRule, } from "./insights/index";
|
|
10
|
+
export { AnomalyDetector, RecommendationEngine } from "./insights/index";
|
|
11
|
+
export type { DashboardConfig, DashboardData, DashboardWidget, ExportConfig, ExportFormat, ExportResult, KPIData, WidgetData, } from "./reports/index";
|
|
12
|
+
export { DashboardGenerator, ExportManager } from "./reports/index";
|
|
13
|
+
export { AnalyticsService } from "./services/analytics.service";
|
|
14
|
+
export { InsightEngine } from "./services/insight.engine";
|
|
15
|
+
export { MetricsCollector } from "./services/metrics.collector";
|
|
16
|
+
export { ReportGenerator } from "./services/report.generator";
|
|
17
|
+
export type { AggregatedMetric, AnalyticsConfig, AnalyticsQuery, AnalyticsReport, AnalyticsResult, InsightData, MetricData, ReportMetric, } from "./types/analytics.types";
|
|
18
|
+
export { MetricType } from "./types/analytics.types";
|