Skip to content

Commit

Permalink
feat(CanaryConfigIndexingAgent): add current and expected counts as t…
Browse files Browse the repository at this point in the history
…hey affect health (#272)
  • Loading branch information
Michael Graff committed Apr 4, 2018
1 parent 41f38f6 commit 08b81ae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,18 @@ protected void doHealthCheck(Health.Builder builder) throws Exception {
}
}

int expectedByApplicationIndexCount = configurationStoreAccountCredentialsSet.size();
// So long as this instance has performed an indexing, or failed to acquire the lock since another instance was in
// the process of indexing, the index should be available. We also verify that the number of by-application index
// keys matches the number of configured configuration store accounts.
if (cyclesCompleted > 0 && existingByApplicationIndexCount == configurationStoreAccountCredentialsSet.size()) {
if (cyclesCompleted > 0 && existingByApplicationIndexCount == expectedByApplicationIndexCount) {
builder.up();
} else {
builder.down();
}

builder.withDetail("existingByApplicationIndexCount", existingByApplicationIndexCount);
builder.withDetail("expectedByApplicationIndexCount", expectedByApplicationIndexCount);
builder.withDetail("cyclesInitiated", cyclesInitiated);
builder.withDetail("cyclesCompleted", cyclesCompleted);
}
Expand Down

0 comments on commit 08b81ae

Please sign in to comment.