Skip to content

Commit

Permalink
add overmind folder data to machine status
Browse files Browse the repository at this point in the history
  • Loading branch information
commandocamel committed Mar 13, 2017
1 parent eb7613c commit 7481af7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class MachineStatus
private long sourceCodeSizeBytes;
private long cerebroCount;
private long cerebroSizeBytes;
private long overmindCount;
private long overmindSizeBytes;
private long freeSpaceLeftBytes;
private String machineName;
private String pid;
Expand Down Expand Up @@ -87,6 +89,22 @@ public long getCerebroSizeBytes() {
return cerebroSizeBytes;
}

public void setOvermindCount(long overmindCount) {
this.overmindCount = overmindCount;
}

public long getOvermindCount() {
return overmindCount;
}

public void setOvermindSizeBytes(long overmindSizeBytes) {
this.overmindSizeBytes = overmindSizeBytes;
}

public long getOvermindSizeBytes() {
return overmindSizeBytes;
}

public void setFreeSpaceLeftBytes(long freeSpaceLeftBytes) {
this.freeSpaceLeftBytes = freeSpaceLeftBytes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class StatusStorageResource {
private static final String cerebroSizeName = "cerebro size";
private static final String cerebroCountName = "cerebro count";
private static final String cerebroDirectoryName = "cerebro";
private static final String overmindSizeName = "overmind size";
private static final String overmindCountName = "overmind count";
private static final String overmindDirectoryName = "overmind";

protected final String folderPath;

Expand Down Expand Up @@ -72,6 +75,8 @@ private void collectDataInfo(MachineStatus machineStatus) {
machineStatus.setSourceCodeCount(mappedData.get(sourceCodesCountName));
machineStatus.setCerebroSizeBytes(mappedData.get(cerebroSizeName));
machineStatus.setCerebroCount(mappedData.get(cerebroCountName));
machineStatus.setOvermindSizeBytes(mappedData.get(overmindSizeName));
machineStatus.setOvermindCount(mappedData.get(overmindCountName));
machineStatus.setFreeSpaceLeftBytes(directory.getFreeSpace());
}

Expand Down Expand Up @@ -118,6 +123,10 @@ private void directoryHandler(Map<String, Long> map, File directory) {
handleSpecialDirectory(directory, cerebroSizeName, cerebroCountName, map);
break;
}
case overmindDirectoryName: {
handleSpecialDirectory(directory, overmindSizeName, overmindCountName, map);
break;
}
default : {
traverseTreeForData(directory, map);
}
Expand Down Expand Up @@ -162,6 +171,8 @@ private Map<String, Long> initializeMapForData() {
result.put(sourceCodesCountName, 0l);
result.put(cerebroSizeName, 0l);
result.put(cerebroCountName, 0l);
result.put(overmindSizeName, 0l);
result.put(overmindCountName, 0l);

return result;
}
Expand Down

0 comments on commit 7481af7

Please sign in to comment.