-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b58fe6
commit 26fa319
Showing
12 changed files
with
85 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import {NextRequest, NextResponse} from "next/server"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import { | ||
ErrorResponse, | ||
SearchParamDateOrUndefined, | ||
SearchParamStringOrUndefined | ||
ErrorResponse, | ||
SearchParamDateOrUndefined, | ||
SearchParamStringOrUndefined, | ||
} from "@lib/api-utils"; | ||
import applicationContainer from "@server/applicationContainer"; | ||
|
||
export async function GET(request: NextRequest) { | ||
try { | ||
const service = SearchParamStringOrUndefined(request.nextUrl.searchParams, "service"); | ||
const from = SearchParamDateOrUndefined(request.nextUrl.searchParams, "from"); | ||
const to = SearchParamDateOrUndefined(request.nextUrl.searchParams, "to"); | ||
try { | ||
const service = SearchParamStringOrUndefined(request.nextUrl.searchParams, "service"); | ||
const from = SearchParamDateOrUndefined(request.nextUrl.searchParams, "from"); | ||
const to = SearchParamDateOrUndefined(request.nextUrl.searchParams, "to"); | ||
try { | ||
const metricsController = applicationContainer.getMetricsController(); | ||
const metrics = await metricsController.GetMetricsForDashboard(service, from, to); | ||
return NextResponse.json(metrics, { status: 200 }); | ||
} catch (error) { | ||
return ErrorResponse(error, 500); | ||
} | ||
const metricsController = applicationContainer.getMetricsController(); | ||
const metrics = await metricsController.GetMetricsForDashboard(service, from, to); | ||
return NextResponse.json(metrics, { status: 200 }); | ||
} catch (error) { | ||
return ErrorResponse(error, 400); | ||
return ErrorResponse(error, 500); | ||
} | ||
} | ||
} catch (error) { | ||
return ErrorResponse(error, 400); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { | ||
EndpointActivityDashboardDAO, | ||
EndpointActivityDashboardSchema | ||
EndpointActivityDashboardDAO, | ||
EndpointActivityDashboardSchema, | ||
} from "@server/domain/dao/endpointActivityDashboard"; | ||
import {z} from "zod"; | ||
import { z } from "zod"; | ||
|
||
export interface DashboardDataDAO { | ||
endpointActivity: EndpointActivityDashboardDAO; | ||
endpointActivity: EndpointActivityDashboardDAO; | ||
} | ||
|
||
export const DashboardDataSchema = z.object({ | ||
endpointActivity: EndpointActivityDashboardSchema, | ||
}); | ||
endpointActivity: EndpointActivityDashboardSchema, | ||
}); |
6 changes: 3 additions & 3 deletions
6
atlas-metrics/app/server/domain/dao/endpointActivityBucket.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 14 additions & 9 deletions
23
atlas-metrics/app/server/domain/dao/endpointActivityDashboard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import {z} from "zod"; | ||
import {TimeSeriesChartDataItemDAO, TimeSeriesChartDataItemSchema, ChartDataItemDAO, ChartDataItemSchema} from "@server/domain/dao/ChartDataItem"; | ||
import { z } from "zod"; | ||
import { | ||
TimeSeriesChartDataItemDAO, | ||
TimeSeriesChartDataItemSchema, | ||
ChartDataItemDAO, | ||
ChartDataItemSchema, | ||
} from "@server/domain/dao/ChartDataItem"; | ||
|
||
export interface EndpointActivityDashboardDAO { | ||
timeSeries: TimeSeriesChartDataItemDAO[]; | ||
byType: ChartDataItemDAO[]; | ||
byCategory: ChartDataItemDAO[]; | ||
timeSeries: TimeSeriesChartDataItemDAO[]; | ||
byType: ChartDataItemDAO[]; | ||
byCategory: ChartDataItemDAO[]; | ||
} | ||
|
||
export const EndpointActivityDashboardSchema = z.object({ | ||
timeSeries: TimeSeriesChartDataItemSchema.array(), | ||
byType: ChartDataItemSchema.array(), | ||
byCategory: ChartDataItemSchema.array(), | ||
}); | ||
timeSeries: TimeSeriesChartDataItemSchema.array(), | ||
byType: ChartDataItemSchema.array(), | ||
byCategory: ChartDataItemSchema.array(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters