Skip to content

Commit

Permalink
Fix a bug of not setting global_word_count (envoyproxy#1974)
Browse files Browse the repository at this point in the history
* Fix a bug of not setting global_word_count

Signed-off-by: Wayne Zhang <[email protected]>

* not to save global_dict_size

Signed-off-by: Wayne Zhang <[email protected]>
  • Loading branch information
qiwzhang authored and istio-testing committed Sep 15, 2018
1 parent b33ceb2 commit cf892b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/istio/mixerclient/attribute_compressor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ void CompressByDict(const Attributes& attributes, MessageDictionary& dict,
class BatchCompressorImpl : public BatchCompressor {
public:
BatchCompressorImpl(const GlobalDictionary& global_dict)
: dict_(global_dict) {
report_.set_global_word_count(global_dict.size());
}
: global_dict_(global_dict), dict_(global_dict) {}

void Add(const Attributes& attributes) override {
CompressByDict(attributes, dict_, report_.add_attributes());
Expand All @@ -140,6 +138,7 @@ class BatchCompressorImpl : public BatchCompressor {
for (const std::string& word : dict_.GetWords()) {
report_.add_default_words(word);
}
report_.set_global_word_count(global_dict_.size());
return report_;
}

Expand All @@ -149,6 +148,7 @@ class BatchCompressorImpl : public BatchCompressor {
}

private:
const GlobalDictionary& global_dict_;
MessageDictionary dict_;
::istio::mixer::v1::ReportRequest report_;
};
Expand Down

0 comments on commit cf892b3

Please sign in to comment.