-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Stats::RawStatData into a StatsOptions struct #3629
Changes from 18 commits
bb349a1
7bfa762
27990bf
b92ab75
3a7aff1
3f38407
19f9f3c
06bd4c2
217f72f
1ae932c
b07d5c6
732af4f
7328dc0
71f6b24
2aa9d8c
911fc5d
dbcdb72
9a30244
aeb9251
cb0fd8a
19e0311
4cad816
9c6b880
c1fa6fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,43 @@ class Instance; | |
|
||
namespace Stats { | ||
|
||
/** | ||
* Struct stored under Server::Options to hold information about the maximum object name length and | ||
* maximum stat suffix length of a stat. These have defaults in StatsOptionsImpl, and the maximum | ||
* object name length can be overridden. The default initialization is used in IsolatedStatImpl, and | ||
* the user-overridden struct is stored in Options. | ||
* | ||
* As noted in the comment above StatsOptionsImpl in source/common/stats/stats_impl.h, a stat name | ||
* often contains both a string whose length is user-defined (cluster_name in the below example), | ||
* and a specific statistic name generated by Envoy. To make room for growth on both fronts, we | ||
* limit the max allowed length of each separately. | ||
* | ||
* name / stat name | ||
* |----------------------------------------------------------------| | ||
* cluster.<cluster_name>.outlier_detection.ejections_consecutive_5xx | ||
* |--------------------------------------| |-----------------------| | ||
* object name suffix | ||
*/ | ||
class StatsOptions { | ||
public: | ||
virtual ~StatsOptions() {} | ||
|
||
/** | ||
* The max allowed length of a complete stat name, including suffix. | ||
*/ | ||
virtual size_t maxNameLength() const PURE; | ||
|
||
/** | ||
* The max allowed length of the object part of a stat name. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the object part and the suffix part of a stat? Can you potentially provide an example in the comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's more color in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just comment about where the other comments are? In general I would expect the public includes to have the detail so I can understand what things mean, but fine to link to other places. Whatever works. It's mostly that this nomenclature caught me off guard so I think it might confuse others also. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds good to me. I did some work in 732af4f. |
||
*/ | ||
virtual size_t maxObjNameLength() const PURE; | ||
|
||
/** | ||
* The max allowed length of a stat suffix. | ||
*/ | ||
virtual size_t maxStatSuffixLength() const PURE; | ||
}; | ||
|
||
/** | ||
* General representation of a tag. | ||
*/ | ||
|
@@ -329,6 +366,12 @@ class Scope { | |
* @return a histogram within the scope's namespace with a particular value type. | ||
*/ | ||
virtual Histogram& histogram(const std::string& name) PURE; | ||
|
||
/** | ||
* @return a reference to the top-level StatsOptions struct, containing information about the | ||
* maximum allowable object name length and stat suffix length. | ||
*/ | ||
virtual const Stats::StatsOptions& statsOptions() const PURE; | ||
}; | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document these methods.