1#ifndef NANOMMO_SERVER_METRICS_H_
2#define NANOMMO_SERVER_METRICS_H_
8#include "prometheus/counter.h"
9#include "prometheus/family.h"
10#include "prometheus/gauge.h"
11#include "prometheus/histogram.h"
12#include "prometheus/registry.h"
20 void SetPlayers(
const char* land, std::size_t count);
23 void SetCopies(
const char* land, std::size_t count);
50 const std::shared_ptr<prometheus::Registry>&
registry()
const {
55 std::shared_ptr<prometheus::Registry> registry_;
56 prometheus::Family<prometheus::Gauge>& players_;
57 prometheus::Family<prometheus::Gauge>& copies_;
58 prometheus::Histogram& tick_seconds_;
59 prometheus::Histogram& save_seconds_;
60 prometheus::Counter& bytes_sent_;
61 prometheus::Counter& messages_received_;
62 prometheus::Family<prometheus::Counter>& chat_lines_;
63 prometheus::Family<prometheus::Counter>& stories_;
64 prometheus::Histogram& story_seconds_;
65 prometheus::Family<prometheus::Counter>& dropped_;
66 prometheus::Counter& war_kills_;
78 void ObserveRequest(
const char* result, std::chrono::nanoseconds time);
80 const std::shared_ptr<prometheus::Registry>&
registry()
const {
85 std::shared_ptr<prometheus::Registry> registry_;
86 prometheus::Family<prometheus::Histogram>& seconds_;
const std::shared_ptr< prometheus::Registry > & registry() const
void ObserveRequest(const char *result, std::chrono::nanoseconds time)
void AddMessageReceived()
void SetCopies(const char *land, std::size_t count)
How many copies of the land the server runs.
void AddBytesSent(std::size_t bytes)
void AddDropped(const char *why)
void AddChatLine(const char *result)
A line of chat, by what became of it: said, or refused.
const std::shared_ptr< prometheus::Registry > & registry() const
void AddStory(const char *result)
void ObserveStory(std::chrono::nanoseconds time)
From when the player asked to when the story was told.
void ObserveSave(std::chrono::nanoseconds time)
void ObserveTick(std::chrono::nanoseconds time)
void SetPlayers(const char *land, std::size_t count)
void AddWarKills(std::size_t count)
Kills in a guild war, which go to the saver, for their wars' scores.