Skip to content

Commit

Permalink
Check last modified time in redex.
Browse files Browse the repository at this point in the history
Summary: This used to be a condition in data pipeline. Now we want it to be configurable in redex.

Reviewed By: NTillmann

Differential Revision: D51815942

fbshipit-source-id: 00babf688dbd00d849aba1dc0603a8154493c216
  • Loading branch information
Jidong Chen authored and facebook-github-bot committed Dec 7, 2023
1 parent c572f97 commit e0f1dab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
19 changes: 8 additions & 11 deletions libredex/ConfigFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,15 @@ void ConfigFiles::build_dead_class_and_live_class_split_lists() {
DeadClassLoadCounts load_counts;
StringTabSplitter splitter(line);
std::string_view classname = splitter.get();
if (splitter.next()) {
std::string_view str = splitter.get();
from_chars(str, &load_counts.sampled);
if (splitter.next()) {
str = splitter.get();
from_chars(str, &load_counts.unsampled);
if (splitter.next()) {
str = splitter.get();
from_chars(str, &load_counts.beta_unsampled);
}
}
const uint32_t k_num_remaining_columns = 4;
std::array<int64_t*, k_num_remaining_columns> columns = {
&load_counts.sampled, &load_counts.unsampled,
&load_counts.beta_unsampled, &load_counts.last_modified_count};
for (uint32_t i = 0; splitter.next() && i < k_num_remaining_columns;
i++) {
from_chars(splitter.get(), columns[i]);
}

bool is_relocated = is_relocated_class(classname);
if (is_relocated) {
remove_relocated_part(&classname);
Expand Down
3 changes: 3 additions & 0 deletions libredex/ConfigFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ struct ConfigFiles {
int64_t sampled{50}; // legacy
int64_t unsampled{0};
int64_t beta_unsampled{0}; // Whether is beta sample or not
int64_t last_modified_count{1}; // number of times that last modified time
// fall into acceptable range. Default value
// 1 is for backward compatibility.
};

const std::unordered_map<std::string, DeadClassLoadCounts>&
Expand Down

0 comments on commit e0f1dab

Please sign in to comment.