14#include "sparta/utils/Utils.hpp"
18class StatisticInstance;
223 visibility_(rhp.visibility_),
225 instrument_type_(rhp.instrument_type_)
236 const std::string& name,
237 const std::string& group,
239 const std::string& desc,
244 visibility_(visibility),
246 instrument_type_(type)
253 const std::string& name,
254 const std::string& group,
256 const std::string& desc,
260 visibility_(visibility),
262 instrument_type_(type)
269 const std::string& name,
270 const std::string& group,
272 const std::string& desc,
291 const std::string& group,
293 const std::string& desc,
312 const std::string& group,
314 const std::string& desc,
335 const std::string& group,
337 const std::string& desc,
356 const std::string& name,
357 const std::string& desc,
375 const std::string& name,
376 const std::string& desc,
396 const std::string& name,
397 const std::string& desc,
418 const std::string& desc,
437 const std::string& desc,
458 const std::string& desc,
508 return instrument_type_;
518 virtual bool groupedPrinting(
const std::vector<const StatisticInstance*> & sub_stats,
519 std::set<const void*> & dont_print_these,
523 (void) dont_print_these;
529 virtual bool groupedPrintingReduced(
const std::vector<const StatisticInstance*> & sub_stats,
530 std::set<const void*> & dont_print_these,
534 (void) dont_print_these;
540 virtual bool groupedPrintingDetail(
const std::vector<const StatisticInstance*> & sub_stats,
541 std::set<const void*> & dont_print_these,
545 (void) dont_print_these;
551 using StringPair = std::pair<std::string, std::string>;
552 const std::vector<StringPair> & getMetadata()
const {
566 metadata_.emplace_back(std::make_pair(key, value));
584 Type instrument_type_;
589 std::vector<StringPair> metadata_;
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
Basic Node framework in sparta device tree composite pattern.
InstrumentationNode(const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type, visibility_t visibility)
InstrumentationNode constructor with no parent Node.
InstrumentationNode()=delete
Not default-constructable.
static constexpr visibility_t CONTAINER_DEFAULT_VISIBILITY
the actual visibility that the sparta containers such as buffer, queue, and array will use when VIS_S...
Type
Instrumentation types. All subclasses will provide this type.
@ TYPE_STATISTICDEF
Statisitic definition.
@ NUM_TYPES
Maximum Type value (illegal)
@ TYPE_PARAMETER
Parameter.
@ TYPE_COUNTER
Counter (of any subclass)
@ TYPE_HISTOGRAM
Histogram Node, which should have relevant stats and counters as (indirect) children.
static constexpr visibility_t DEFAULT_VISIBILITY
Default node visibility.
InstrumentationNode(const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type, visibility_t visibility, class_t n_class)
InstrumentationNode constructor with no parent Node.
visibility_t getVisibility() const
Gets the visibility hint of this node. This is invariant after construction.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &desc, Type type, visibility_t visibility)
InstrumentationNode constructor with no group information.
uint32_t visibility_t
Continuous visibility level. Several key points along continum are indicated within Visibility.
InstrumentationNode(const std::string &name, const std::string &desc, Type type, visibility_t visibility)
InstrumentationNode constructor with no parent node or information.
static constexpr class_t DEFAULT_CLASS
Default node class.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type, visibility_t visibility)
InstrumentationNode full constructor.
Visibility
Common visibility levels. Visibility is a continum (visibility can be anywhere in [0 to MAX_VISIBILIT...
@ VIS_HIDDEN
Hidden hint. Lowest possible visibility.
@ VIS_CRITICAL
2) High-importance data that end-users should always see.
@ VIS_MAX
Maximum possible visibility.
@ VIS_SUPPORT
Supporting data. Used mainly for counters which contain an intermediate value for the sole purpose of...
@ VIS_DETAIL
Detailed data. Might be confusing or esoteric for end-users.
@ VIS_SUMMARY
The next two visibility levels are for High-importance data. These are split up in the (100M,...
@ VIS_NORMAL
Normal visibility (default)
Class
Common Class levels. Class is a continum (class can be anywhere in [0 to MAX_CLASS])
@ CLASS_OTHER
Other hint. Lowest possible class.
@ CLASS_CRITICAL
important class (default)
@ CLASS_IMPORTANT
important class (default)
uint32_t class_t
Continuous Class level. Several key points along continum are indicated within Class.
static constexpr visibility_t AUTO_VISIBILITY
The default sparta resource visibility value that should be used. This is an alias of VIS_MAX at the ...
InstrumentationNode(const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type)
InstrumentationNode constructor with no parent Node.
InstrumentationNode(const InstrumentationNode &)=delete
Not copy-constructable.
InstrumentationNode & operator=(const InstrumentationNode &)=delete
Not assign-constructable.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &desc, Type type, visibility_t visibility, class_t n_class)
InstrumentationNode constructor with no group information.
Type getInstrumentationType() const
Gets the instrumentaiton type hint of this node. This is invariant after construction.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type, visibility_t visibility, class_t n_class)
InstrumentationNode full constructor.
static constexpr class_t CONTAINER_DEFAULT_CLASS
the actual class that the sparta containers such as buffer, queue, and array will use when CLASS_SPAR...
void addMetadata_(const std::string &key, const std::string &value)
Add any arbitrary metadata as strings to this object. Used to add extra information to statistics rep...
class_t getClass() const
Gets the class hint of this node. This is invariant after construction.
InstrumentationNode(InstrumentationNode &&rhp)
Move constructor.
virtual ~InstrumentationNode()
Virtual destructor.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &desc, Type type)
InstrumentationNode constructor with no group information.
static constexpr class_t AUTO_CLASS
The default sparta resource class value that should be used. This is an alias of CLASS_IMPORTANT at t...
InstrumentationNode(const std::string &name, const std::string &desc, Type type, visibility_t visibility, class_t n_class)
InstrumentationNode constructor with no parent node or information.
InstrumentationNode(const std::string &name, const std::string &desc, Type type)
InstrumentationNode constructor with no parent node or information.
InstrumentationNode(TreeNode *parent, const std::string &name, const std::string &group, group_idx_type group_idx, const std::string &desc, Type type)
InstrumentationNode full constructor.
Node in a composite tree representing a sparta Tree item.
static const group_idx_type GROUP_IDX_NONE
GroupIndex indicating that a node has no group index because it belongs to no group.
static constexpr char GROUP_NAME_NONE[]
Group name indicating that a node belongs to no group.
uint32_t group_idx_type
Index within a group.
Macros for handling exponential backoff.