Add commitHash entry

This commit is contained in:
chimp1984 2020-10-31 12:19:54 -05:00
parent 37170abfd5
commit 77666a6d64
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
4 changed files with 7 additions and 0 deletions

View file

@ -27,6 +27,7 @@ import bisq.core.dao.state.DaoStateService;
import bisq.core.network.p2p.inventory.messages.GetInventoryRequest;
import bisq.core.network.p2p.inventory.messages.GetInventoryResponse;
import bisq.core.network.p2p.inventory.model.InventoryItem;
import bisq.core.network.p2p.inventory.model.RequestInfo;
import bisq.network.p2p.network.Connection;
import bisq.network.p2p.network.MessageListener;
@ -144,6 +145,7 @@ public class GetInventoryRequestHandler implements MessageListener {
// node
inventory.put(InventoryItem.version, Version.VERSION);
inventory.put(InventoryItem.commitHash, RequestInfo.COMMIT_HASH);
inventory.put(InventoryItem.usedMemory, String.valueOf(Profiler.getUsedMemoryInBytes()));
inventory.put(InventoryItem.jvmStartTime, String.valueOf(ManagementFactory.getRuntimeMXBean().getStartTime()));

View file

@ -122,6 +122,7 @@ public enum InventoryItem {
// No deviation check
version("version", false),
commitHash("commitHash", false),
usedMemory("usedMemory", true),
jvmStartTime("jvmStartTime", true);

View file

@ -28,6 +28,9 @@ import org.jetbrains.annotations.Nullable;
@Getter
public class RequestInfo {
// Carries latest commit hash of feature changes (not latest commit as that is then the commit for editing that field)
public static final String COMMIT_HASH = "37170abf";
private final long requestStartTime;
@Setter
private long responseTime;

View file

@ -158,6 +158,7 @@ public class InventoryWebServer {
if (requestInfo != null) {
sb.append("Version: ").append(requestInfo.getDisplayValue(InventoryItem.version)).append("<br/>");
sb.append("Commit hash: ").append(requestInfo.getDisplayValue(InventoryItem.commitHash)).append("<br/>");
String memory = requestInfo.getValue(InventoryItem.usedMemory);
String memoryString = memory != null ? Utilities.readableFileSize(Long.parseLong(memory)) : "n/a";
sb.append("Memory used: ")