@abyss-project/monitor 1.0.52 → 1.0.54

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.
@@ -0,0 +1,4 @@
1
+ import { IGetHourlyMetricsParams, IGetHourlyMetricsQuery, IGetHourlyMetricsResponse, IGetAggregatedHourlyMetricsParams, IGetAggregatedHourlyMetricsQuery, IGetAggregatedHourlyMetricsResponse, IGetHourlyMetricsComparisonParams, IGetHourlyMetricsComparisonQuery, IGetHourlyMetricsComparisonResponse } from '../types';
2
+ export declare const getHourlyMetrics: (params: IGetHourlyMetricsParams, query: IGetHourlyMetricsQuery) => Promise<IGetHourlyMetricsResponse>;
3
+ export declare const getAggregatedHourlyMetrics: (params: IGetAggregatedHourlyMetricsParams, query: IGetAggregatedHourlyMetricsQuery) => Promise<IGetAggregatedHourlyMetricsResponse>;
4
+ export declare const getHourlyMetricsComparison: (params: IGetHourlyMetricsComparisonParams, query: IGetHourlyMetricsComparisonQuery) => Promise<IGetHourlyMetricsComparisonResponse>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHourlyMetricsComparison = exports.getAggregatedHourlyMetrics = exports.getHourlyMetrics = void 0;
4
+ const __1 = require("..");
5
+ const getHourlyMetrics = async (params, query) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`metrics/hourly/${params.projectId}`, { params: query })).data;
7
+ };
8
+ exports.getHourlyMetrics = getHourlyMetrics;
9
+ const getAggregatedHourlyMetrics = async (params, query) => {
10
+ return (await __1.AbyssMonitorCore.axios.get(`metrics/hourly/${params.projectId}/aggregated`, { params: query })).data;
11
+ };
12
+ exports.getAggregatedHourlyMetrics = getAggregatedHourlyMetrics;
13
+ const getHourlyMetricsComparison = async (params, query) => {
14
+ return (await __1.AbyssMonitorCore.axios.get(`metrics/hourly/${params.projectId}/comparison`, { params: query })).data;
15
+ };
16
+ exports.getHourlyMetricsComparison = getHourlyMetricsComparison;
@@ -16,5 +16,6 @@ export * from './application-webhook-history.admin.api';
16
16
  export * from './application-sentinel.api';
17
17
  export * from './application-sentinel.admin.api';
18
18
  export * from './metrics.api';
19
+ export * from './hourly-metrics.api';
19
20
  export * from './report.admin.api';
20
21
  export * from './infrastructure.admin.api';
package/dist/api/index.js CHANGED
@@ -32,5 +32,6 @@ __exportStar(require("./application-webhook-history.admin.api"), exports);
32
32
  __exportStar(require("./application-sentinel.api"), exports);
33
33
  __exportStar(require("./application-sentinel.admin.api"), exports);
34
34
  __exportStar(require("./metrics.api"), exports);
35
+ __exportStar(require("./hourly-metrics.api"), exports);
35
36
  __exportStar(require("./report.admin.api"), exports);
36
37
  __exportStar(require("./infrastructure.admin.api"), exports);
@@ -20,6 +20,7 @@ export * from './requests/application-sentinel.admin.request';
20
20
  export * from './requests/application-sentinel.request';
21
21
  export * from './requests/metrics.request';
22
22
  export * from './requests/metrics.admin.request';
23
+ export * from './requests/hourly-metrics.request';
23
24
  export * from './requests/report.admin.request';
24
25
  export * from './requests/infrastructure.admin.request';
25
26
  export * from './responses/application.response';
@@ -41,5 +42,6 @@ export * from './responses/application-sentinel.admin.response';
41
42
  export * from './responses/application-sentinel.response';
42
43
  export * from './responses/metrics.response';
43
44
  export * from './responses/metrics.admin.response';
45
+ export * from './responses/hourly-metrics.response';
44
46
  export * from './responses/report.admin.response';
45
47
  export * from './responses/infrastructure.admin.response';
@@ -36,6 +36,7 @@ __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
38
  __exportStar(require("./requests/metrics.admin.request"), exports);
39
+ __exportStar(require("./requests/hourly-metrics.request"), exports);
39
40
  __exportStar(require("./requests/report.admin.request"), exports);
40
41
  __exportStar(require("./requests/infrastructure.admin.request"), exports);
41
42
  __exportStar(require("./responses/application.response"), exports);
@@ -57,5 +58,6 @@ __exportStar(require("./responses/application-sentinel.admin.response"), exports
57
58
  __exportStar(require("./responses/application-sentinel.response"), exports);
58
59
  __exportStar(require("./responses/metrics.response"), exports);
59
60
  __exportStar(require("./responses/metrics.admin.response"), exports);
61
+ __exportStar(require("./responses/hourly-metrics.response"), exports);
60
62
  __exportStar(require("./responses/report.admin.response"), exports);
61
63
  __exportStar(require("./responses/infrastructure.admin.response"), exports);
@@ -0,0 +1,28 @@
1
+ export interface IGetHourlyMetricsParams {
2
+ projectId: string;
3
+ }
4
+ export interface IGetHourlyMetricsQuery {
5
+ applicationIds?: string[];
6
+ startDate?: Date;
7
+ endDate?: Date;
8
+ limit?: number;
9
+ offset?: number;
10
+ granularity?: 'hour' | 'day' | 'week' | 'month';
11
+ }
12
+ export interface IGetAggregatedHourlyMetricsParams {
13
+ projectId: string;
14
+ }
15
+ export interface IGetAggregatedHourlyMetricsQuery {
16
+ applicationIds?: string[];
17
+ startDate?: Date;
18
+ endDate?: Date;
19
+ }
20
+ export interface IGetHourlyMetricsComparisonParams {
21
+ projectId: string;
22
+ }
23
+ export interface IGetHourlyMetricsComparisonQuery {
24
+ applicationIds: string[];
25
+ startDate?: Date;
26
+ endDate?: Date;
27
+ metrics?: string[];
28
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,4 +10,5 @@ export interface IFillHourlyMetricsAdminBody {
10
10
  export interface IAggregateHourAdminBody {
11
11
  applicationIds?: string[];
12
12
  applicationCronTaskHistoryId?: string;
13
+ referenceDate?: Date;
13
14
  }
@@ -0,0 +1,90 @@
1
+ import { IResponse, IApplicationHourlyMetrics } from '../..';
2
+ export interface IHourlyMetricsRecord extends Omit<IApplicationHourlyMetrics, 'application'> {
3
+ }
4
+ export interface IAggregatedMetricsSummary {
5
+ totalRequests: number;
6
+ totalHttpErrors: number;
7
+ totalHttpWarnings: number;
8
+ avgResponseTime: number;
9
+ errorRate: number;
10
+ availabilityRate: number;
11
+ totalLogs: number;
12
+ totalCronTasks: number;
13
+ successfulCronTasks: number;
14
+ failedCronTasks: number;
15
+ totalEvents: number;
16
+ totalWebhooks: number;
17
+ successfulWebhooks: number;
18
+ failedWebhooks: number;
19
+ totalSentinelChecks: number;
20
+ successfulSentinelChecks: number;
21
+ failedSentinelChecks: number;
22
+ avgCpuPercent: number | null;
23
+ maxCpuPercent: number | null;
24
+ avgMemoryPercent: number | null;
25
+ maxMemoryPercent: number | null;
26
+ maxMemoryBytes: number | null;
27
+ logsByLevel: Record<number, number>;
28
+ topErrorEndpoints: Array<{
29
+ endpoint: string;
30
+ count: number;
31
+ }>;
32
+ topEvents: Array<{
33
+ name: string;
34
+ count: number;
35
+ }>;
36
+ allStatusCodes: Array<{
37
+ statusCode: number;
38
+ count: number;
39
+ }>;
40
+ errorsByStatusCode: Array<{
41
+ statusCode: number;
42
+ count: number;
43
+ }>;
44
+ }
45
+ export interface IMetricsTimeSeriesPoint {
46
+ timestamp: string;
47
+ value: number;
48
+ }
49
+ export interface IMetricsTimeSeries {
50
+ metricName: string;
51
+ applicationId: string;
52
+ data: IMetricsTimeSeriesPoint[];
53
+ }
54
+ export interface IGetHourlyMetricsData {
55
+ metricsByApplication: Record<string, IHourlyMetricsRecord[]>;
56
+ totalByApplication: Record<string, number>;
57
+ periodStart: string;
58
+ periodEnd: string;
59
+ }
60
+ export type IGetHourlyMetricsResponse = IResponse<IGetHourlyMetricsData>;
61
+ export interface IGetAggregatedHourlyMetricsData {
62
+ aggregatedByApplication: Record<string, IAggregatedMetricsSummary>;
63
+ overallAggregated: IAggregatedMetricsSummary;
64
+ periodStart: string;
65
+ periodEnd: string;
66
+ hoursInPeriod: number;
67
+ }
68
+ export type IGetAggregatedHourlyMetricsResponse = IResponse<IGetAggregatedHourlyMetricsData>;
69
+ export interface IApplicationMetricsComparison {
70
+ applicationId: string;
71
+ aggregated: IAggregatedMetricsSummary;
72
+ trends: {
73
+ requests: IMetricsTimeSeriesPoint[];
74
+ errors: IMetricsTimeSeriesPoint[];
75
+ responseTime: IMetricsTimeSeriesPoint[];
76
+ availability: IMetricsTimeSeriesPoint[];
77
+ };
78
+ }
79
+ export interface IGetHourlyMetricsComparisonData {
80
+ applications: IApplicationMetricsComparison[];
81
+ periodStart: string;
82
+ periodEnd: string;
83
+ }
84
+ export type IGetHourlyMetricsComparisonResponse = IResponse<IGetHourlyMetricsComparisonData>;
85
+ export interface IGetMetricsTimeSeriesData {
86
+ series: IMetricsTimeSeries[];
87
+ periodStart: string;
88
+ periodEnd: string;
89
+ }
90
+ export type IGetMetricsTimeSeriesResponse = IResponse<IGetMetricsTimeSeriesData>;
@@ -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.52",
3
+ "version": "1.0.54",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",