add metrics (without reporting, for now)

This commit is contained in:
sam 2024-08-15 17:23:56 +02:00
parent 5585ffd6ea
commit 14b132e466
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
9 changed files with 183 additions and 9 deletions

View file

@ -8,13 +8,13 @@ public class Config
public DatabaseConfig Database { get; init; } = new();
public DiscordConfig Discord { get; init; } = new();
public WebConfig Web { get; init; } = new();
public class LoggingConfig
{
public LogEventLevel LogEventLevel { get; init; } = LogEventLevel.Debug;
public bool LogQueries { get; init; } = false;
}
public class DatabaseConfig
{
public string Url { get; init; } = string.Empty;
@ -37,7 +37,9 @@ public class Config
{
public string Host { get; init; } = "localhost";
public int Port { get; init; } = 5000;
public int? MetricsPort { get; init; }
public string BaseUrl { get; init; } = null!;
public string Address => $"http://{Host}:{Port}";
public string MetricsAddress => $"http://{Host}:{MetricsPort ?? Port}";
}
}