xrpld
Loading...
Searching...
No Matches
Groups.h
1#pragma once
2
3#include <xrpl/beast/insight/Collector.h>
4#include <xrpl/beast/insight/Group.h>
5
6#include <memory>
7#include <string>
8
9namespace beast::insight {
10
12class Groups
13{
14public:
15 virtual ~Groups() = 0;
16
19 virtual Group::ptr const&
20 get(std::string const& name) = 0;
21
22 Group::ptr const&
24 {
25 return get(name);
26 }
27
28};
29
32makeGroups(Collector::ptr const& collector);
33
34} // namespace beast::insight
std::shared_ptr< Collector > ptr
Definition Collector.h:26
std::shared_ptr< Group > ptr
Definition Group.h:14
A container for managing a set of metric groups.
Definition Groups.h:13
Group::ptr const & operator[](std::string const &name)
Definition Groups.h:23
virtual Group::ptr const & get(std::string const &name)=0
Find or create a new collector with a given name.
std::unique_ptr< Groups > makeGroups(Collector::ptr const &collector)
Create a group container that uses the specified collector.
Definition Groups.cpp:115