|
1 | 1 | package prometheus |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "GoGeizhalsBot/internal/database" |
5 | 4 | "net/http" |
6 | 5 |
|
7 | 6 | "github.com/VictoriaMetrics/metrics" |
8 | 7 | ) |
9 | 8 |
|
10 | 9 | var ( |
11 | | - totalUniqueUsers = metrics.NewGauge("gogeizhalsbot_unique_users_total", func() float64 { |
12 | | - return float64(database.GetUserCount()) |
| 10 | + TotalUniqueUsersValue int64 |
| 11 | + totalUniqueUsers = metrics.NewGauge("gogeizhalsbot_unique_users_total", func() float64 { |
| 12 | + return float64(TotalUniqueUsersValue) |
13 | 13 | }) |
14 | | - totalUniquePriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents", func() float64 { |
15 | | - return float64(database.GetPriceAgentCount()) |
| 14 | + |
| 15 | + TotalUniquePriceagentsValue int64 |
| 16 | + totalUniquePriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents", func() float64 { |
| 17 | + return float64(TotalUniquePriceagentsValue) |
16 | 18 | }) |
17 | | - totalUniqueProductPriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents{type=\"product\"}", func() float64 { |
18 | | - return float64(database.GetPriceAgentProductCount()) |
| 19 | + |
| 20 | + TotalUniqueProductPriceagentsValue int64 |
| 21 | + totalUniqueProductPriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents{type=\"product\"}", func() float64 { |
| 22 | + return float64(TotalUniqueProductPriceagentsValue) |
19 | 23 | }) |
20 | | - totalUniqueWishlistPriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents{type=\"wishlist\"}", func() float64 { |
21 | | - return float64(database.GetPriceAgentWishlistCount()) |
| 24 | + |
| 25 | + TotalUniqueWishlistPriceagentsValue int64 |
| 26 | + totalUniqueWishlistPriceagents = metrics.NewGauge("gogeizhalsbot_unique_priceagents{type=\"wishlist\"}", func() float64 { |
| 27 | + return float64(TotalUniqueWishlistPriceagentsValue) |
22 | 28 | }) |
23 | | - totalUniqueProductPriceagentsValue int64 |
24 | 29 |
|
25 | 30 | TotalUserInteractions = metrics.NewCounter("gogeizhalsbot_user_interactions_total") |
26 | 31 | GeizhalsHTTPRequests = metrics.NewCounter("gogeizhalsbot_geizhals_http_requests_total") |
27 | 32 | PriceagentNotifications = metrics.NewCounter("gogeizhalsbot_priceagent_notifications_total") |
28 | | - ProxyErrors = metrics.NewCounter("gogeizhalsbot_proxy_errors_total") |
| 33 | + HttpErrors = metrics.NewCounter("gogeizhalsbot_http_errors_total") |
29 | 34 | GraphsRendered = metrics.NewCounter("gogeizhalsbot_graphs_rendered_total") |
30 | 35 | ) |
31 | 36 |
|
|
0 commit comments