MCPcopy Create free account
hub / github.com/Card-Forge/forge / getHWInfo

Method getHWInfo

forge-gui/src/main/java/forge/gui/GuiBase.java:38–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 downloadsDir = dir;
37 }
38 public static String getHWInfo() {
39 Runtime runtime = Runtime.getRuntime();
40 StringBuilder sb = new StringBuilder();
41 sb.append("##########################################");
42 sb.append("\nAPP: Forge v.").append(getInterface().getCurrentVersion());
43 if (hwInfo != null) {
44 sb.append("\nDEV: ").append(hwInfo.device().getName());
45 sb.append(hwInfo.getChipset()
46 ? "\nSOC: " + hwInfo.device().getChipset()
47 : "\nCPU: " + hwInfo.device().getCpuDescription());
48 sb.append("\nRAM: ").append(hwInfo.getTotalRam()).append(" MB");
49 sb.append("\nOS: ").append(hwInfo.os().getRawDescription());
50 } else {
51 sb.append("\nJava: ").append(System.getProperty("java.version"))
52 .append(" (").append(System.getProperty("java.vendor")).append(")");
53 sb.append("\nOS: ").append(System.getProperty("os.name"))
54 .append(" ").append(System.getProperty("os.version"))
55 .append(" ").append(System.getProperty("os.arch"));
56 sb.append("\nRAM: ").append(runtime.maxMemory() / 1024 / 1024)
57 .append(" MB max, ").append(runtime.availableProcessors()).append(" CPUs");
58 }
59 sb.append("\n##########################################");
60 return sb.toString();
61 }
62 public static void logHWInfo() {
63 for (String line : getHWInfo().split("\n")) {
64 Logger.info(line);

Callers 3

logHWInfoMethod · 0.95
saveToFileMethod · 0.95
writeSystemInfoHeaderMethod · 0.95

Calls 7

getInterfaceMethod · 0.95
getTotalRamMethod · 0.80
getCurrentVersionMethod · 0.65
getNameMethod · 0.65
appendMethod · 0.45
getPropertyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected