clean up review

This commit is contained in:
Ravi Prasad
2025-06-03 22:56:34 -05:00
parent 24ec6675c9
commit 03177f58f2
12 changed files with 95242 additions and 13 deletions
Vendored
BIN
View File
Binary file not shown.
+125 -4
View File
@@ -106,6 +106,58 @@ const docTemplate = `{
} }
} }
}, },
"/api/playeradvancedstats/scrape": {
"get": {
"tags": [
"PlayerStats"
],
"summary": "Scrape player advanced stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/playershotchart": { "/api/playershotchart": {
"get": { "get": {
"security": [ "security": [
@@ -160,9 +212,9 @@ const docTemplate = `{
} }
} }
}, },
"/api/playershotchart/fetch": { "/api/playershotchart/scrape": {
"get": { "get": {
"description": "Imports shot-chart data for the given playerId and stores/updates in DB", "description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -172,14 +224,28 @@ const docTemplate = `{
"tags": [ "tags": [
"PlayerShotChart" "PlayerShotChart"
], ],
"summary": "Fetch a single player's shot-chart data from external API", "summary": "Scrape a player's shot-chart from BR website",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "Player ID (e.g., hardeja01)", "description": "Player ID (e.g. derozde01)",
"name": "playerId", "name": "playerId",
"in": "query", "in": "query",
"required": true "required": true
},
{
"type": "integer",
"description": "Start season (e.g. 2024)",
"name": "startSeason",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "End season (e.g. 2021)",
"name": "endSeason",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@@ -302,6 +368,58 @@ const docTemplate = `{
} }
} }
} }
},
"/api/playertotals/scrape": {
"get": {
"tags": [
"PlayerTotals"
],
"summary": "Scrape player total stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
} }
}, },
"definitions": { "definitions": {
@@ -438,6 +556,7 @@ const docTemplate = `{
"type": "integer" "type": "integer"
}, },
"id": { "id": {
"description": "Autoincrement primary key — works in SQLite and any other DB.",
"type": "integer" "type": "integer"
}, },
"lead": { "lead": {
@@ -453,9 +572,11 @@ const docTemplate = `{
"type": "integer" "type": "integer"
}, },
"playerId": { "playerId": {
"description": "────────── \"identity\" columns (the dedup key) ──────────",
"type": "string" "type": "string"
}, },
"playerName": { "playerName": {
"description": "────────── the rest of the payload ──────────",
"type": "string" "type": "string"
}, },
"qtr": { "qtr": {
+125 -4
View File
@@ -103,6 +103,58 @@
} }
} }
}, },
"/api/playeradvancedstats/scrape": {
"get": {
"tags": [
"PlayerStats"
],
"summary": "Scrape player advanced stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/playershotchart": { "/api/playershotchart": {
"get": { "get": {
"security": [ "security": [
@@ -157,9 +209,9 @@
} }
} }
}, },
"/api/playershotchart/fetch": { "/api/playershotchart/scrape": {
"get": { "get": {
"description": "Imports shot-chart data for the given playerId and stores/updates in DB", "description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@@ -169,14 +221,28 @@
"tags": [ "tags": [
"PlayerShotChart" "PlayerShotChart"
], ],
"summary": "Fetch a single player's shot-chart data from external API", "summary": "Scrape a player's shot-chart from BR website",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "Player ID (e.g., hardeja01)", "description": "Player ID (e.g. derozde01)",
"name": "playerId", "name": "playerId",
"in": "query", "in": "query",
"required": true "required": true
},
{
"type": "integer",
"description": "Start season (e.g. 2024)",
"name": "startSeason",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "End season (e.g. 2021)",
"name": "endSeason",
"in": "query",
"required": true
} }
], ],
"responses": { "responses": {
@@ -299,6 +365,58 @@
} }
} }
} }
},
"/api/playertotals/scrape": {
"get": {
"tags": [
"PlayerTotals"
],
"summary": "Scrape player total stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
} }
}, },
"definitions": { "definitions": {
@@ -435,6 +553,7 @@
"type": "integer" "type": "integer"
}, },
"id": { "id": {
"description": "Autoincrement primary key — works in SQLite and any other DB.",
"type": "integer" "type": "integer"
}, },
"lead": { "lead": {
@@ -450,9 +569,11 @@
"type": "integer" "type": "integer"
}, },
"playerId": { "playerId": {
"description": "────────── \"identity\" columns (the dedup key) ──────────",
"type": "string" "type": "string"
}, },
"playerName": { "playerName": {
"description": "────────── the rest of the payload ──────────",
"type": "string" "type": "string"
}, },
"qtr": { "qtr": {
+85 -5
View File
@@ -88,6 +88,7 @@ definitions:
distanceFt: distanceFt:
type: integer type: integer
id: id:
description: Autoincrement primary key — works in SQLite and any other DB.
type: integer type: integer
lead: lead:
type: boolean type: boolean
@@ -98,8 +99,10 @@ definitions:
opponentTeamScore: opponentTeamScore:
type: integer type: integer
playerId: playerId:
description: ────────── "identity" columns (the dedup key) ──────────
type: string type: string
playerName: playerName:
description: ────────── the rest of the payload ──────────
type: string type: string
qtr: qtr:
type: string type: string
@@ -184,6 +187,40 @@ paths:
summary: Get player advanced stats summary: Get player advanced stats
tags: tags:
- PlayerStats - PlayerStats
/api/playeradvancedstats/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player advanced stats from BR website
tags:
- PlayerStats
/api/playershotchart: /api/playershotchart:
get: get:
consumes: consumes:
@@ -219,18 +256,27 @@ paths:
summary: Get shot-chart data summary: Get shot-chart data
tags: tags:
- PlayerShotChart - PlayerShotChart
/api/playershotchart/fetch: /api/playershotchart/scrape:
get: get:
consumes: consumes:
- application/json - application/json
description: Imports shot-chart data for the given playerId and stores/updates description: Scrapes seasons [startSeason…endSeason] for the given playerId
in DB
parameters: parameters:
- description: Player ID (e.g., hardeja01) - description: Player ID (e.g. derozde01)
in: query in: query
name: playerId name: playerId
required: true required: true
type: string type: string
- description: Start season (e.g. 2024)
in: query
name: startSeason
required: true
type: integer
- description: End season (e.g. 2021)
in: query
name: endSeason
required: true
type: integer
produces: produces:
- application/json - application/json
responses: responses:
@@ -252,7 +298,7 @@ paths:
additionalProperties: additionalProperties:
type: string type: string
type: object type: object
summary: Fetch a single player's shot-chart data from external API summary: Scrape a player's shot-chart from BR website
tags: tags:
- PlayerShotChart - PlayerShotChart
/api/playertotals: /api/playertotals:
@@ -314,6 +360,40 @@ paths:
summary: Get player total stats summary: Get player total stats
tags: tags:
- PlayerTotals - PlayerTotals
/api/playertotals/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player total stats from BR website
tags:
- PlayerTotals
schemes: schemes:
- http - http
- https - https
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
@@ -0,0 +1,367 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 3,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"options": {
"displayMode": "lcd",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"delta"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"text": {
"titleSize": 14
},
"valueMode": "color"
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\", status=\"200\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Stats",
"transparent": true,
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": true,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": true,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 7,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 10
},
"id": 2,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"timezone": [
"browser"
],
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(instance) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Adv Stats individual endpoints",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(endpoint) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "{{Total}}",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Requests",
"transparent": true,
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 14,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 3,
"pointSize": 9,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green"
},
{
"color": "light-blue",
"value": 20
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbits"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 22
},
"id": 4,
"options": {
"legend": {
"calcs": [
"count"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
"sortBy": "Count",
"sortDesc": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (process_network_transmit_bytes_total{job=\"nba-api\"})",
"fullMetaSearch": true,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Panel Title",
"transparent": true,
"type": "timeseries"
}
],
"preload": true,
"refresh": "5s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "NBA dashboard Copy",
"uid": "benwlv17an8cgd",
"version": 1
}
@@ -0,0 +1,408 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "11.6.1"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"options": {
"displayMode": "lcd",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"delta"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"text": {
"titleSize": 14
},
"valueMode": "color"
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\", status=\"200\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Stats",
"transparent": true,
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": true,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": true,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 7,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 10
},
"id": 2,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"timezone": [
"browser"
],
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(instance) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Adv Stats individual endpoints",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(endpoint) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "{{Total}}",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Requests",
"transparent": true,
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 14,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 3,
"pointSize": 9,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green"
},
{
"color": "light-blue",
"value": 20
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbits"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 22
},
"id": 4,
"options": {
"legend": {
"calcs": [
"count"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
"sortBy": "Count",
"sortDesc": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (process_network_transmit_bytes_total{job=\"nba-api\"})",
"fullMetaSearch": true,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
}
}
],
"title": "Panel Title",
"transparent": true,
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "NBA dashboard Copy",
"uid": "benwlv17an8cgd",
"version": 1,
"weekStart": ""
}
@@ -0,0 +1,362 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"options": {
"displayMode": "lcd",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"delta"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"text": {
"titleSize": 14
},
"valueMode": "color"
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\", status=\"200\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Stats",
"transparent": true,
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 7,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "always",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 10
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"timezone": [
"browser"
],
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(endpoint) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Adv Stats individual endpoints",
"useBackend": false
}
],
"title": "Panel Title",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 14,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 3,
"pointSize": 9,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green"
},
{
"color": "light-blue",
"value": 20
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 22
},
"id": 4,
"options": {
"legend": {
"calcs": [
"count"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
"sortBy": "Count",
"sortDesc": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (process_network_transmit_bytes_total{job=\"nba-api\"})",
"fullMetaSearch": true,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Panel Title",
"transparent": true,
"type": "timeseries"
}
],
"preload": true,
"refresh": "5s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "NBA dashboard",
"uid": "bent2fb718074d",
"version": 1
}
@@ -0,0 +1,403 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "11.6.1"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"options": {
"displayMode": "lcd",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"delta"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"text": {
"titleSize": 14
},
"valueMode": "color"
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\", status=\"200\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Stats",
"transparent": true,
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 7,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "always",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 10
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"timezone": [
"browser"
],
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(endpoint) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Adv Stats individual endpoints",
"useBackend": false
}
],
"title": "Panel Title",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 14,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 3,
"pointSize": 9,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green"
},
{
"color": "light-blue",
"value": 20
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 22
},
"id": 4,
"options": {
"legend": {
"calcs": [
"count"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
"sortBy": "Count",
"sortDesc": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (process_network_transmit_bytes_total{job=\"nba-api\"})",
"fullMetaSearch": true,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
}
}
],
"title": "Panel Title",
"transparent": true,
"type": "timeseries"
}
],
"refresh": "5s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "NBA dashboard",
"uid": "bent2fb718074d",
"version": 1,
"weekStart": ""
}
@@ -0,0 +1,367 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 3,
"options": {
"displayMode": "lcd",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"delta"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"text": {
"titleSize": 14
},
"valueMode": "color"
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\", status=\"200\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Stats",
"transparent": true,
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": true,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": true,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 7,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 10
},
"id": 2,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"timezone": [
"browser"
],
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(instance) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "Adv Stats individual endpoints",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(endpoint) (nba_http_requests_total{endpoint=\"/api/playeradvancedstats/\"})",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
"instant": false,
"legendFormat": "{{Total}}",
"range": true,
"refId": "Advanced Stats Endpoint Sum",
"useBackend": false
}
],
"title": "Requests",
"transparent": true,
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 14,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 3,
"pointSize": 9,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green"
},
{
"color": "light-blue",
"value": 20
},
{
"color": "red",
"value": 80
}
]
},
"unit": "decbits"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 22
},
"id": 4,
"options": {
"legend": {
"calcs": [
"count"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": false,
"sortBy": "Count",
"sortDesc": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.6.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(job) (process_network_transmit_bytes_total{job=\"nba-api\"})",
"fullMetaSearch": true,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Panel Title",
"transparent": true,
"type": "timeseries"
}
],
"preload": true,
"refresh": "5s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "NBA dashboard",
"uid": "bent2fb718074d",
"version": 1
}
+93000
View File
File diff suppressed because it is too large Load Diff