13#include "sparta/utils/Utils.hpp"
17class StatisticInstance;
222 visibility_(rhp.visibility_),
224 instrument_type_(rhp.instrument_type_)
235 const std::string& name,
236 const std::string& group,
238 const std::string& desc,
243 visibility_(visibility),
245 instrument_type_(type)
252 const std::string& name,
253 const std::string& group,
255 const std::string& desc,
259 visibility_(visibility),
261 instrument_type_(type)
268 const std::string& name,
269 const std::string& group,
271 const std::string& desc,
290 const std::string& group,
292 const std::string& desc,
311 const std::string& group,
313 const std::string& desc,
334 const std::string& group,
336 const std::string& desc,
355 const std::string& name,
356 const std::string& desc,
374 const std::string& name,
375 const std::string& desc,
395 const std::string& name,
396 const std::string& desc,
417 const std::string& desc,
436 const std::string& desc,
457 const std::string& desc,
507 return instrument_type_;
517 virtual bool groupedPrinting(
const std::vector<const StatisticInstance*> & sub_stats,
518 std::set<const void*> & dont_print_these,
522 (void) dont_print_these;
528 virtual bool groupedPrintingReduced(
const std::vector<const StatisticInstance*> & sub_stats,
529 std::set<const void*> & dont_print_these,
533 (void) dont_print_these;
539 virtual bool groupedPrintingDetail(
const std::vector<const StatisticInstance*> & sub_stats,
540 std::set<const void*> & dont_print_these,
544 (void) dont_print_these;
550 using StringPair = std::pair<std::string, std::string>;
551 const std::vector<StringPair> & getMetadata()
const {
565 metadata_.emplace_back(std::make_pair(key, value));
583 Type instrument_type_;
588 std::vector<StringPair> metadata_;
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
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.
uint32_t visibility_t
Continuous visibility level. Several key points along continum are indicated within Visibility.
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.
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)
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.
uint32_t class_t
Continuous Class level. Several key points along continum are indicated within Class.
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.