Skip to content
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

Fix a bug of not setting global_word_count #1974

Merged
merged 2 commits into from
Sep 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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