empiredan commented on code in PR #1117:
URL: https://github.com/apache/incubator-pegasus/pull/1117#discussion_r956689572
##########
src/rdsn/include/dsn/utility/metrics.h:
##########
@@ -134,10 +135,13 @@ class metric_prototype;
class metric;
using metric_ptr = ref_ptr<metric>;
+class metric_data_sink;
+using metric_data_sink_ptr = ref_ptr<metric_data_sink>;
+
class metric_entity : public ref_counter
{
public:
- using attr_map = std::unordered_map<std::string, std::string>;
+ using attr_map = std::map<std::string, std::string>;
Review Comment:
All of the attributes of an entity will be used as the labels of the metric.
The labels will later be passed to `metric_snapshot`, thus each metric snapshot
may has multiple labels. To maintain each snapshot in a map, data sink may
choose to encode the labels a snapshot has, as what
`metric_snapshot::encode_attributes` has done. In comparison with
`std::unordered_map`, it is easier for `std::map` to be encoded since it's
ordered.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]