feat: expose insights into user activity (#9807)

This commit is contained in:
Marcin Tojek
2023-09-26 18:42:16 +02:00
committed by GitHub
parent 1f4335733c
commit 4c3b579f58
38 changed files with 2148 additions and 70 deletions

86
coderd/apidoc/docs.go generated
View File

@ -934,6 +934,31 @@ const docTemplate = `{
}
}
},
"/insights/user-activity": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Insights"
],
"summary": "Get insights about user activity",
"operationId": "get-insights-about-user-activity",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.UserActivityInsightsResponse"
}
}
}
}
},
"/insights/user-latency": {
"get": {
"security": [
@ -10378,6 +10403,67 @@ const docTemplate = `{
}
}
},
"codersdk.UserActivity": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string",
"format": "uri"
},
"seconds": {
"type": "integer",
"example": 80500
},
"template_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"user_id": {
"type": "string",
"format": "uuid"
},
"username": {
"type": "string"
}
}
},
"codersdk.UserActivityInsightsReport": {
"type": "object",
"properties": {
"end_time": {
"type": "string",
"format": "date-time"
},
"start_time": {
"type": "string",
"format": "date-time"
},
"template_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.UserActivity"
}
}
}
},
"codersdk.UserActivityInsightsResponse": {
"type": "object",
"properties": {
"report": {
"$ref": "#/definitions/codersdk.UserActivityInsightsReport"
}
}
},
"codersdk.UserLatency": {
"type": "object",
"properties": {

View File

@ -804,6 +804,27 @@
}
}
},
"/insights/user-activity": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": ["application/json"],
"tags": ["Insights"],
"summary": "Get insights about user activity",
"operationId": "get-insights-about-user-activity",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.UserActivityInsightsResponse"
}
}
}
}
},
"/insights/user-latency": {
"get": {
"security": [
@ -9392,6 +9413,67 @@
}
}
},
"codersdk.UserActivity": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string",
"format": "uri"
},
"seconds": {
"type": "integer",
"example": 80500
},
"template_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"user_id": {
"type": "string",
"format": "uuid"
},
"username": {
"type": "string"
}
}
},
"codersdk.UserActivityInsightsReport": {
"type": "object",
"properties": {
"end_time": {
"type": "string",
"format": "date-time"
},
"start_time": {
"type": "string",
"format": "date-time"
},
"template_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.UserActivity"
}
}
}
},
"codersdk.UserActivityInsightsResponse": {
"type": "object",
"properties": {
"report": {
"$ref": "#/definitions/codersdk.UserActivityInsightsReport"
}
}
},
"codersdk.UserLatency": {
"type": "object",
"properties": {