@abyss-project/monitor 1.0.50 → 1.0.52

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.
@@ -19,6 +19,7 @@ export * from './requests/application-webhook-history.request';
19
19
  export * from './requests/application-sentinel.admin.request';
20
20
  export * from './requests/application-sentinel.request';
21
21
  export * from './requests/metrics.request';
22
+ export * from './requests/metrics.admin.request';
22
23
  export * from './requests/report.admin.request';
23
24
  export * from './requests/infrastructure.admin.request';
24
25
  export * from './responses/application.response';
@@ -39,5 +40,6 @@ export * from './responses/application-webhook-history.response';
39
40
  export * from './responses/application-sentinel.admin.response';
40
41
  export * from './responses/application-sentinel.response';
41
42
  export * from './responses/metrics.response';
43
+ export * from './responses/metrics.admin.response';
42
44
  export * from './responses/report.admin.response';
43
45
  export * from './responses/infrastructure.admin.response';
@@ -35,6 +35,7 @@ __exportStar(require("./requests/application-webhook-history.request"), exports)
35
35
  __exportStar(require("./requests/application-sentinel.admin.request"), exports);
36
36
  __exportStar(require("./requests/application-sentinel.request"), exports);
37
37
  __exportStar(require("./requests/metrics.request"), exports);
38
+ __exportStar(require("./requests/metrics.admin.request"), exports);
38
39
  __exportStar(require("./requests/report.admin.request"), exports);
39
40
  __exportStar(require("./requests/infrastructure.admin.request"), exports);
40
41
  __exportStar(require("./responses/application.response"), exports);
@@ -55,5 +56,6 @@ __exportStar(require("./responses/application-webhook-history.response"), export
55
56
  __exportStar(require("./responses/application-sentinel.admin.response"), exports);
56
57
  __exportStar(require("./responses/application-sentinel.response"), exports);
57
58
  __exportStar(require("./responses/metrics.response"), exports);
59
+ __exportStar(require("./responses/metrics.admin.response"), exports);
58
60
  __exportStar(require("./responses/report.admin.response"), exports);
59
61
  __exportStar(require("./responses/infrastructure.admin.response"), exports);
@@ -6,6 +6,11 @@ export interface IResetSecretPublishTokenApplicationAdminParams {
6
6
  applicationId: string;
7
7
  }
8
8
  export type IPaginateApplicationAdminQuery = QueryPaginate;
9
+ export interface IPaginateHourlyMetricsApplicationAdminQuery extends QueryPaginate {
10
+ applicationId: string;
11
+ startDate?: Date;
12
+ endDate?: Date;
13
+ }
9
14
  export type ICreateApplicationAdminBody = {
10
15
  projectId: string;
11
16
  externalApplicationId: string;
@@ -53,3 +53,12 @@ export interface ICallPerControllerAnalyticsApplicationQuery {
53
53
  dateValueBefore?: Date;
54
54
  dateValueAfter?: Date;
55
55
  }
56
+ export interface IPaginateHourlyMetricsApplicationParams {
57
+ applicationId: string;
58
+ }
59
+ export interface IPaginateHourlyMetricsApplicationQuery {
60
+ page?: number;
61
+ limit?: number;
62
+ startDate?: Date;
63
+ endDate?: Date;
64
+ }
@@ -0,0 +1,13 @@
1
+ export interface IFillLifetimeMetricsAdminBody {
2
+ applicationIds?: string[];
3
+ force?: boolean;
4
+ }
5
+ export interface IFillHourlyMetricsAdminBody {
6
+ applicationIds?: string[];
7
+ days?: number;
8
+ force?: boolean;
9
+ }
10
+ export interface IAggregateHourAdminBody {
11
+ applicationIds?: string[];
12
+ applicationCronTaskHistoryId?: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,10 @@
1
- import { IResponse, IApplication, BasePaginate } from '../..';
1
+ import { IResponse, IApplication, BasePaginate, IApplicationHourlyMetrics } from '../..';
2
2
  export interface IGetApplicationAdminData {
3
3
  application: IApplication;
4
4
  }
5
5
  export type IGetApplicationAdminResponse = IResponse<IGetApplicationAdminData>;
6
6
  export type IPaginateApplicationAdminResponse = IResponse<BasePaginate<IApplication>>;
7
+ export type IPaginateHourlyMetricsApplicationAdminResponse = IResponse<BasePaginate<IApplicationHourlyMetrics>>;
7
8
  export interface IResetSecretPublishTokenApplicationAdminData {
8
9
  application: IApplication;
9
10
  }
@@ -1,4 +1,4 @@
1
- import { IResponse, IApplication } from '../..';
1
+ import { IResponse, IApplication, BasePaginate, IApplicationHourlyMetrics } from '../..';
2
2
  import { APIMethod } from '../../../enum';
3
3
  export interface IGetApplicationData {
4
4
  application: IApplication;
@@ -127,3 +127,4 @@ export interface ICallPerControllerAnalyticsApplicationData {
127
127
  }[];
128
128
  }
129
129
  export type ICallPerControllerAnalyticsApplicationResponse = IResponse<ICallPerControllerAnalyticsApplicationData>;
130
+ export type IPaginateHourlyMetricsApplicationResponse = IResponse<BasePaginate<IApplicationHourlyMetrics>>;
@@ -0,0 +1,19 @@
1
+ import { IResponse } from '../..';
2
+ export interface IFillLifetimeMetricsData {
3
+ success: boolean;
4
+ message: string;
5
+ requestId: string;
6
+ }
7
+ export type IFillLifetimeMetricsAdminResponse = IResponse<IFillLifetimeMetricsData>;
8
+ export interface IFillHourlyMetricsData {
9
+ success: boolean;
10
+ message: string;
11
+ requestId: string;
12
+ }
13
+ export type IFillHourlyMetricsAdminResponse = IResponse<IFillHourlyMetricsData>;
14
+ export interface IAggregateHourData {
15
+ success: boolean;
16
+ message: string;
17
+ requestId: string;
18
+ }
19
+ export type IAggregateHourAdminResponse = IResponse<IAggregateHourData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,27 @@
1
1
  import { LogLevel } from '../../../enum';
2
+ export interface CoreLifetimeMetrics {
3
+ totalRequests: number;
4
+ totalHttpErrors: number;
5
+ totalHttpWarnings: number;
6
+ totalLogs: number;
7
+ totalCronTasks: number;
8
+ successfulCronTasks: number;
9
+ failedCronTasks: number;
10
+ totalEvents: number;
11
+ totalWebhooks: number;
12
+ successfulWebhooks: number;
13
+ failedWebhooks: number;
14
+ totalSentinelChecks: number;
15
+ successfulSentinelChecks: number;
16
+ failedSentinelChecks: number;
17
+ logsByLevel: Record<number, number>;
18
+ }
19
+ export interface ComputedMetrics {
20
+ averageResponseTime: number;
21
+ mostUsedEndpoint: string;
22
+ errorRate: number;
23
+ availabilityRate: number;
24
+ }
2
25
  export interface RequestsByPeriod {
3
26
  period: string;
4
27
  count: number;
@@ -7,6 +30,10 @@ export interface ErrorsByStatusCode {
7
30
  statusCode: number;
8
31
  count: number;
9
32
  }
33
+ export interface AllStatusCodes {
34
+ statusCode: number;
35
+ count: number;
36
+ }
10
37
  export interface TopErrorEndpoint {
11
38
  endpoint: string;
12
39
  count: number;
@@ -16,52 +43,37 @@ export interface LogsByPeriod {
16
43
  level: LogLevel;
17
44
  count: number;
18
45
  }
19
- export interface LogsByLevel {
20
- level: LogLevel;
46
+ export interface TopEvent {
47
+ name: string;
21
48
  count: number;
22
49
  }
23
- export interface LifetimeMetrics {
24
- totalRequests: number;
25
- totalErrors: number;
26
- totalWarnings: number;
27
- totalLogs: number;
28
- totalCronTasks: number;
29
- successfulCronTasks: number;
30
- failedCronTasks: number;
31
- totalEvents: number;
32
- totalWebhooks: number;
33
- successfulWebhooks: number;
34
- failedWebhooks: number;
35
- totalSentinelChecks: number;
36
- successfulSentinelChecks: number;
37
- failedSentinelChecks: number;
38
- logsByLevel: Array<LogsByLevel>;
50
+ export interface EventsByPeriod {
51
+ period: string;
52
+ count: number;
39
53
  }
40
- export interface ApplicationMetrics {
41
- totalRequests: number;
42
- totalErrors: number;
43
- totalWarnings: number;
44
- averageResponseTime: number;
45
- peakRequestsPerDay: number;
46
- mostUsedEndpoint: string;
47
- errorRate: number;
48
- availabilityRate: number;
49
- requestsByPeriod: Array<RequestsByPeriod>;
54
+ export interface MetricsBreakdowns {
50
55
  errorsByStatusCode: Array<ErrorsByStatusCode>;
56
+ allStatusCodes: Array<AllStatusCodes>;
51
57
  topErrorEndpoints: Array<TopErrorEndpoint>;
52
- totalLogs: number;
53
- totalCronTasks: number;
54
- successfulCronTasks: number;
55
- failedCronTasks: number;
56
- totalEvents: number;
57
- totalWebhooks: number;
58
- successfulWebhooks: number;
59
- failedWebhooks: number;
60
- totalSentinelChecks: number;
61
- successfulSentinelChecks: number;
62
- failedSentinelChecks: number;
58
+ topEvents: Array<TopEvent>;
59
+ }
60
+ export interface ApplicationStatsMetrics {
61
+ avgCpuPercent: number | null;
62
+ minCpuPercent: number | null;
63
+ maxCpuPercent: number | null;
64
+ avgMemoryPercent: number | null;
65
+ minMemoryPercent: number | null;
66
+ maxMemoryPercent: number | null;
67
+ avgMemoryBytes: number | null;
68
+ minMemoryBytes: number | null;
69
+ maxMemoryBytes: number | null;
70
+ }
71
+ export interface ApplicationMetrics extends CoreLifetimeMetrics, ComputedMetrics, MetricsBreakdowns {
72
+ requestsByPeriod: Array<RequestsByPeriod>;
73
+ eventsByPeriod: Array<EventsByPeriod>;
63
74
  logsByPeriod: Array<LogsByPeriod>;
64
- lifetime: LifetimeMetrics;
75
+ stats: ApplicationStatsMetrics;
76
+ lifetime: CoreLifetimeMetrics;
65
77
  }
66
78
  export interface GetReportAdminResponse {
67
79
  data: {
@@ -10,5 +10,7 @@ export * from './models/application-webhook-history.model';
10
10
  export * from './models/application-sentinel.model';
11
11
  export * from './models/application-sentinel-history.model';
12
12
  export * from './models/partition-optimization-history.model';
13
+ export * from './models/application-lifetime-metrics.model';
14
+ export * from './models/application-hourly-metrics.model';
13
15
  export * from './api';
14
16
  export * from './dto';
@@ -26,5 +26,7 @@ __exportStar(require("./models/application-webhook-history.model"), exports);
26
26
  __exportStar(require("./models/application-sentinel.model"), exports);
27
27
  __exportStar(require("./models/application-sentinel-history.model"), exports);
28
28
  __exportStar(require("./models/partition-optimization-history.model"), exports);
29
+ __exportStar(require("./models/application-lifetime-metrics.model"), exports);
30
+ __exportStar(require("./models/application-hourly-metrics.model"), exports);
29
31
  __exportStar(require("./api"), exports);
30
32
  __exportStar(require("./dto"), exports);
@@ -0,0 +1,14 @@
1
+ import { CoreLifetimeMetrics, ApplicationStatsMetrics, MetricsBreakdowns } from '../api/responses/report.admin.response';
2
+ export interface HourlyComputedMetrics {
3
+ avgResponseTime: number;
4
+ mostUsedEndpoint: string;
5
+ errorRate: number;
6
+ availabilityRate: number;
7
+ }
8
+ export interface IApplicationHourlyMetrics extends CoreLifetimeMetrics, HourlyComputedMetrics, MetricsBreakdowns, ApplicationStatsMetrics {
9
+ id?: string;
10
+ applicationId: string;
11
+ hour: Date;
12
+ createdAt?: Date;
13
+ updatedAt?: Date;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { CoreLifetimeMetrics } from '../api/responses/report.admin.response';
2
+ export interface IApplicationLifetimeMetrics extends CoreLifetimeMetrics {
3
+ id?: string;
4
+ applicationId: string;
5
+ lastCalculatedAt: Date;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",