-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Prometheus metrics for account registration and concurrent…
… requests feat: Implement Prometheus metrics and caching for game sessions fix: Rename Prometheus metric for game modes to include namespace
- Loading branch information
Showing
11 changed files
with
178 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package savedata | ||
|
||
import ( | ||
"github.com/patrickmn/go-cache" | ||
) | ||
|
||
var Cache = cache.New(cache.NoExpiration, cache.NoExpiration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package savedata | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
gameModeCounter = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "rogueserver_game_mode_total", | ||
Help: "The total number of classic sessions played per 5 minutes", | ||
}, | ||
[]string{"gamemode"}, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
services: | ||
server: | ||
command: --debug --dbaddr db --dbuser pokerogue --dbpass pokerogue --dbname pokeroguedb | ||
image: rogueserver:latest | ||
restart: unless-stopped | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
networks: | ||
- internal | ||
ports: | ||
- "8001:8001" | ||
|
||
db: | ||
image: mariadb:11 | ||
restart: unless-stopped | ||
healthcheck: | ||
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ] | ||
start_period: 10s | ||
start_interval: 10s | ||
interval: 1m | ||
timeout: 5s | ||
retries: 3 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: admin | ||
MYSQL_DATABASE: pokeroguedb | ||
MYSQL_USER: pokerogue | ||
MYSQL_PASSWORD: pokerogue | ||
volumes: | ||
- database:/var/lib/mysql | ||
networks: | ||
- internal | ||
|
||
# Prometheus monitoring stack for the server and db services above | ||
prometheus: | ||
image: prom/prometheus:latest | ||
restart: unless-stopped | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
networks: | ||
- internal | ||
|
||
volumes: | ||
database: | ||
|
||
networks: | ||
internal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
global: | ||
scrape_interval: "10s" | ||
scrape_timeout: "10s" | ||
evaluation_interval: "1m" | ||
|
||
scrape_configs: | ||
- job_name: 'rogueserver' | ||
static_configs: | ||
- targets: ['server:8001'] | ||
- job_name: 'mariadb' | ||
static_configs: | ||
- targets: ['db:3306'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters