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
14class Groups
15{
16public:
17 virtual ~Groups() = 0;
18
23 virtual Group::ptr const&
24 get(std::string const& name) = 0;
25
26 Group::ptr const&
28 {
29 return get(name);
30 }
31
32};
33
38makeGroups(Collector::ptr const& collector);
39
40} // namespace beast::insight
std::shared_ptr< Collector > ptr
Definition Collector.h:29
std::shared_ptr< Group > ptr
Definition Group.h:16
A container for managing a set of metric groups.
Definition Groups.h:15
Group::ptr const & operator[](std::string const &name)
Definition Groups.h:27
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