mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
4b519ead4f
## About the changes This PR improves our queries to Prometheus (instead of making multiple queries do only one) and improves the UI and the code. The reports aggregate all HTTP methods (GET, POST, PUT, DELETE, OPTIONS, HEAD and PATCH) without distinction under the same "endpoint" (a relative path inside unleash up to a certain depth) Co-authored-by: Nuno Góis <nuno@getunleash.ai>
62 lines
2.3 KiB
TypeScript
62 lines
2.3 KiB
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
export const requestsPerSecondSchema = {
|
|
$id: '#/components/schemas/requestsPerSecondSchema',
|
|
type: 'object',
|
|
properties: {
|
|
status: {
|
|
type: 'string',
|
|
},
|
|
data: {
|
|
type: 'object',
|
|
properties: {
|
|
resultType: {
|
|
type: 'string',
|
|
},
|
|
result: {
|
|
description:
|
|
'An array of values per metric. Each one represents a line in the graph labeled by its metric name',
|
|
type: 'array',
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
metric: {
|
|
description:
|
|
'A key value set representing the metric',
|
|
type: 'object',
|
|
properties: {
|
|
appName: {
|
|
type: 'string',
|
|
},
|
|
endpoint: {
|
|
type: 'string',
|
|
},
|
|
},
|
|
},
|
|
values: {
|
|
description:
|
|
'An array of arrays. Each element of the array is an array of size 2 consisting of the 2 axis for the graph: in position zero the x axis represented as a number and position one the y axis represented as string',
|
|
type: 'array',
|
|
items: {
|
|
type: 'array',
|
|
items: {
|
|
anyOf: [
|
|
{ type: 'string' },
|
|
{ type: 'number' },
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
components: {},
|
|
} as const;
|
|
|
|
export type RequestsPerSecondSchema = FromSchema<
|
|
typeof requestsPerSecondSchema
|
|
>;
|