Skip to content

Commit

Permalink
Fix node-startup time calculation bug (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Chattopadhyaya committed Jan 3, 2023
1 parent b3f17d4 commit 43a9ed4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/StressMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private static Callable taskCallable(Workflow workflow, SolrCloud cloud, Map<Str
SolrNode node = cloud.nodes.get(Integer.valueOf(nodeIndex) - 1);
log.info("Restarting " + node.getNodeName());

long stopTime = -1000, startTime = -1000;
long stopTime = 0, startTime = 0;
try {
if (node instanceof LocalSolrNode) {
stopTime = System.currentTimeMillis();
Expand All @@ -295,7 +295,7 @@ private static Callable taskCallable(Workflow workflow, SolrCloud cloud, Map<Str
}

if (type.awaitRecoveries) {
startTime += System.currentTimeMillis();
long recoveryTime = System.currentTimeMillis();
try (CloudSolrClient client = new CloudSolrClient.Builder().withZkHost(cloud.getZookeeperUrl()).build();) {
int numInactive = 0;
do {
Expand All @@ -304,7 +304,8 @@ private static Callable taskCallable(Workflow workflow, SolrCloud cloud, Map<Str
} catch (Exception ex) {
ex.printStackTrace();
}
startTime = startTime - System.currentTimeMillis();
recoveryTime = System.currentTimeMillis() - recoveryTime;
startTime += recoveryTime;
}
long heap = -1;
try {
Expand Down

0 comments on commit 43a9ed4

Please sign in to comment.