Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UXE-6129] feat: add chart average request time #2128

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const HELP_CENTER_URLS = {
'/real-time-metrics/edge-applications/requests/missed-requests-per-second',
missedRequests: '/real-time-metrics/edge-applications/requests/missed-requests',
requestsByMethod: '/real-time-metrics/edge-applications/requests/requests-by-method',
averageRequestTime: '/real-time-metrics/edge-applications/requests/average-request-time',
requestsOffloaded: '/real-time-metrics/edge-applications/requests/requests-offloaded',
requestsPerSecondOffloaded:
'/real-time-metrics/edge-applications/requests/requests-per-second-offloaded',
Expand Down
3 changes: 3 additions & 0 deletions src/modules/real-time-metrics/constants/reports-texts.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ const REPORTS_TEXTS = {
requestsByMethod: {
description:
'Total requests made to your domain divided by the HTTP method used. Displays methods Requests Http Method Get, Requests Http Method Post, Requests Http Method Head, and Requests Http Method Others.'
},
averageRequestTime: {
description: 'average request time in a line chart.'
}
},
bandwidthSaving: {
Expand Down
27 changes: 27 additions & 0 deletions src/modules/real-time-metrics/constants/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,33 @@ const REPORTS = [
dashboardId: '357548623571976783',
helpCenterPath: HELP_CENTER_URLS.edgeApplications.requests.requestsByMethod
},
{
id: '357825388709151310',
chartOwner: 'azion',
label: 'Average Request Time',
description: REPORTS_TEXTS.edgeApplications.httpMethods.averageRequestTime.description,
aggregationType: 'avg',
columns: 6,
type: 'line',
xAxis: 'ts',
isTopX: false,
rotated: false,
dataset: 'httpMetrics',
dataUnit: 'perSecond',
limit: 10000,
fields: [],
groupBy: [],
aggregations: [
{
aggregation: 'avg',
variable: 'requestTime'
}
],
orderDirection: 'ASC',
variationType: 'inverse',
dashboardId: '357548623571976783',
helpCenterPath: HELP_CENTER_URLS.edgeApplications.requests.averageRequestTime
},
/**
* BUILD
* Edge Applications - Status Codes
Expand Down
27 changes: 27 additions & 0 deletions src/tests/modules/real-time-metrics/constants/reports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,33 @@ describe('RealTimeMetricsModule', () => {
type: 'line',
xAxis: 'ts'
},
{
aggregationType: 'avg',
chartOwner: 'azion',
columns: 6,
dashboardId: '357548623571976783',
dataUnit: 'perSecond',
dataset: 'httpMetrics',
description: 'average request time in a line chart.',
fields: [],
groupBy: [],
aggregations: [
{
aggregation: 'avg',
variable: 'requestTime'
}
],
helpCenterPath: '/real-time-metrics/edge-applications/requests/average-request-time',
id: '357825388709151310',
variationType: 'inverse',
isTopX: false,
label: 'Average Request Time',
limit: 10000,
orderDirection: 'ASC',
rotated: false,
type: 'line',
xAxis: 'ts'
},
{
aggregationType: 'sum',
chartOwner: 'azion',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,36 @@ end: $tsRange_end
}
) {
missedRequestsPerSecond
ts
}
}`,
variables: {
tsRange_begin: '2024-01-01T12:00:00',
tsRange_end: '2024-12-01T12:00:00'
}
}
},
{
id: '357825388709151310',
label: 'Average Request Time',
gqlQuery: {
query: `query ($tsRange_begin:DateTime!, $tsRange_end:DateTime!) {
httpMetrics (
limit: 10000
aggregate: {avg: requestTime
}
groupBy: [ts]
orderBy: [ts_ASC]
filter: {
tsRange: {
begin: $tsRange_begin
end: $tsRange_end

}

}
) {
avg
ts
}
}`,
Expand Down
Loading