Files
rippled/include/xrpl/beast/insight/Groups.h

35 lines
697 B
C++

#pragma once
#include <xrpl/beast/insight/Collector.h>
#include <xrpl/beast/insight/Group.h>
#include <memory>
#include <string>
namespace beast::insight {
/** A container for managing a set of metric groups. */
class Groups
{
public:
virtual ~Groups() = 0;
/** Find or create a new collector with a given name. */
/** @{ */
virtual Group::ptr const&
get(std::string const& name) = 0;
Group::ptr const&
operator[](std::string const& name)
{
return get(name);
}
/** @} */
};
/** Create a group container that uses the specified collector. */
std::unique_ptr<Groups>
makeGroups(Collector::ptr const& collector);
} // namespace beast::insight