mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
docs: add description to requests per seconds schemas (#4182)
### What Adds a quick and dirty description to requestPerSeconds and segmentedRequestPerSecondsSchema so the enterprise /rps endpoint has better API docs. --------- Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
This commit is contained in:
parent
d60e505a40
commit
4ce78ccecd
@ -112,7 +112,6 @@ const metaRules: Rule[] = [
|
|||||||
'projectsSchema',
|
'projectsSchema',
|
||||||
'pushVariantsSchema',
|
'pushVariantsSchema',
|
||||||
'resetPasswordSchema',
|
'resetPasswordSchema',
|
||||||
'requestsPerSecondSchema',
|
|
||||||
'sdkContextSchema',
|
'sdkContextSchema',
|
||||||
'setUiConfigSchema',
|
'setUiConfigSchema',
|
||||||
'splashSchema',
|
'splashSchema',
|
||||||
@ -169,8 +168,6 @@ const metaRules: Rule[] = [
|
|||||||
'playgroundStrategySchema',
|
'playgroundStrategySchema',
|
||||||
'pushVariantsSchema',
|
'pushVariantsSchema',
|
||||||
'resetPasswordSchema',
|
'resetPasswordSchema',
|
||||||
'requestsPerSecondSchema',
|
|
||||||
'requestsPerSecondSegmentedSchema',
|
|
||||||
'setStrategySortOrderSchema',
|
'setStrategySortOrderSchema',
|
||||||
'setUiConfigSchema',
|
'setUiConfigSchema',
|
||||||
'sortOrderSchema',
|
'sortOrderSchema',
|
||||||
|
@ -3,15 +3,25 @@ import { FromSchema } from 'json-schema-to-ts';
|
|||||||
export const requestsPerSecondSchema = {
|
export const requestsPerSecondSchema = {
|
||||||
$id: '#/components/schemas/requestsPerSecondSchema',
|
$id: '#/components/schemas/requestsPerSecondSchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description:
|
||||||
|
'Statistics for usage of Unleash, formatted so it can easily be used in a graph',
|
||||||
properties: {
|
properties: {
|
||||||
status: {
|
status: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description:
|
||||||
|
'Whether the query against prometheus succeeded or failed',
|
||||||
|
enum: ['success', 'failure'],
|
||||||
|
example: 'success',
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description: 'The query result from prometheus',
|
||||||
properties: {
|
properties: {
|
||||||
resultType: {
|
resultType: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description: 'Prometheus compatible result type.',
|
||||||
|
enum: ['matrix', 'vector', 'scalar', 'string'],
|
||||||
|
example: 'vector',
|
||||||
},
|
},
|
||||||
result: {
|
result: {
|
||||||
description:
|
description:
|
||||||
@ -19,6 +29,8 @@ export const requestsPerSecondSchema = {
|
|||||||
type: 'array',
|
type: 'array',
|
||||||
items: {
|
items: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description:
|
||||||
|
'A representation of a single metric to build a line in a graph',
|
||||||
properties: {
|
properties: {
|
||||||
metric: {
|
metric: {
|
||||||
description:
|
description:
|
||||||
@ -26,10 +38,16 @@ export const requestsPerSecondSchema = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
appName: {
|
appName: {
|
||||||
|
description:
|
||||||
|
'Name of the application this metric relates to',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
example: 'mySdk',
|
||||||
},
|
},
|
||||||
endpoint: {
|
endpoint: {
|
||||||
|
description:
|
||||||
|
'Which endpoint has been accessed',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
example: '/api/frontend',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -39,10 +57,20 @@ export const requestsPerSecondSchema = {
|
|||||||
type: 'array',
|
type: 'array',
|
||||||
items: {
|
items: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
description:
|
||||||
|
'Either the x axis represented as a number or the y axis represented as a string',
|
||||||
items: {
|
items: {
|
||||||
anyOf: [
|
anyOf: [
|
||||||
{ type: 'string' },
|
{
|
||||||
{ type: 'number' },
|
type: 'string',
|
||||||
|
description:
|
||||||
|
'An identifier for the line in the graph',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
description:
|
||||||
|
'The number of requests at this point in time',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -3,6 +3,7 @@ import { requestsPerSecondSchema } from './requests-per-second-schema';
|
|||||||
export const requestsPerSecondSegmentedSchema = {
|
export const requestsPerSecondSegmentedSchema = {
|
||||||
$id: '#/components/schemas/requestsPerSecondSegmentedSchema',
|
$id: '#/components/schemas/requestsPerSecondSegmentedSchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description: 'Get usage metrics separated by client and admin paths',
|
||||||
properties: {
|
properties: {
|
||||||
clientMetrics: {
|
clientMetrics: {
|
||||||
$ref: '#/components/schemas/requestsPerSecondSchema',
|
$ref: '#/components/schemas/requestsPerSecondSchema',
|
||||||
|
Loading…
Reference in New Issue
Block a user