blob: dc77784908636086984b0d89a9d7d6bf572be190 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
/* */ package NET.worlds.core;
/* */
/* */ import NET.worlds.console.Main;
/* */ import NET.worlds.console.MainCallback;
/* */ import NET.worlds.console.MainTerminalCallback;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SystemInfo
/* */ implements MainCallback, MainTerminalCallback
/* */ {
/* 23 */ private static SystemInfo instance = new SystemInfo();
/* 24 */ private long _lastFrame = 0L; private long _lastReport = 0L;
/* 25 */ private long _min; private long _max; private long _avg; private long _avgCount = 0L;
/* */
/* */ private SystemInfo() {
/* 28 */ Main.register(this);
/* */ }
/* */
/* */ public void mainCallback() {
/* 32 */ long curTime = Std.getFastTime();
/* 33 */ long frameTime = curTime - this._lastFrame;
/* */
/* 35 */ if (frameTime < this._min)
/* 36 */ this._min = frameTime;
/* 37 */ if (frameTime > this._max)
/* 38 */ this._max = frameTime;
/* 39 */ this._avg += frameTime;
/* 40 */ this._avgCount += 1L;
/* */
/* 42 */ if (curTime - this._lastReport > 300000L)
/* */ {
/* 44 */ if (this._lastFrame != 0L) {
/* 45 */ System.out.println(logTime() + "Frame rate report:" + this._min +
/* 46 */ "/" + this._avg / this._avgCount + "/" + this._max);
/* */ }
/* 48 */ this._min = 10000L;
/* 49 */ this._max = 0L;
/* 50 */ this._avg = 0L;
/* 51 */ this._avgCount = 0L;
/* 52 */ this._lastReport = curTime;
/* */ }
/* 54 */ this._lastFrame = curTime;
/* */ }
/* */
/* */ public void terminalCallback() {
/* 58 */ Main.unregister(this);
/* 59 */ if (this._avgCount != 0L) {
/* 60 */ System.out.println(logTime() + "Frame rate report:" + this._min + "/" +
/* 61 */ this._avg / this._avgCount + "/" + this._max);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static void Record(PrintStream out)
/* */ {
/* 71 */ out.println("DISK REPORT:");
/* 72 */ recordPath(out, "Windows SYSTEM path", GetSystemDirectory());
/* 73 */ recordPath(out, "Current Working Directory", GetCurrentDirectory());
/* */
/* */
/* 76 */ out.println("");
/* 77 */ out.println("JAVA MEMORY:");
/* 78 */ out.println(logTime() + "\t Free memory: " +
/* 79 */ Runtime.getRuntime().freeMemory());
/* 80 */ out.println(logTime() + "\tTotal memory: " +
/* 81 */ Runtime.getRuntime().totalMemory());
/* */
/* */
/* 84 */ out.println("");
/* 85 */ out.println("WINDOWS MEMORY:");
/* 86 */ out.println(logTime() + "\tTotal Physical Memory: " +
/* 87 */ GetTotalPhysicalMemory());
/* 88 */ out.println(logTime() + "\tAvail Physical Memory: " +
/* 89 */ GetAvailPhysicalMemory());
/* 90 */ out.println(logTime() + "\t Total Paged Memory: " +
/* 91 */ GetTotalPagedMemory());
/* 92 */ out.println(logTime() + "\t Avail Paged Memory: " +
/* 93 */ GetAvailPagedMemory());
/* */
/* */
/* 96 */ out.println("");
/* 97 */ out.println(logTime() + "Java Properties: " + System.getProperties());
/* 98 */ out.println(logTime() + "Number of CPUs: " + GetNumberOfProcessors());
/* 99 */ out.println(logTime() + "Processor Type: " + GetProcessorType());
/* 100 */ out.println(logTime() + "Platform Type: " + GetPlatformID());
/* */ }
/* */
/* */
/* */
/* */ private static void recordPath(PrintStream out, String comment, String path)
/* */ {
/* 107 */ out.println(logTime() + comment + ": " + path);
/* 108 */ if (path != null)
/* */ {
/* 110 */ String drive = path.substring(0, 2);
/* 111 */ out.println(logTime() + "\tFree disk space (" + drive + "): " +
/* 112 */ GetDiskFreeSpace(new StringBuilder(String.valueOf(drive)).append("\\").toString()) + " KB");
/* */ }
/* */ }
/* */
/* */ public static String logTime() {
/* 117 */ return "[" + Std.getRealTime() + "] ";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static native int GetDiskFreeSpace(String paramString);
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static int GetDiskFreeSpace()
/* */ {
/* 135 */ return GetDiskFreeSpace(null);
/* */ }
/* */
/* */ public static native String GetSystemDirectory();
/* */
/* */ public static native String GetCurrentDirectory();
/* */
/* */ public static native int GetTotalPhysicalMemory();
/* */
/* */ public static native int GetAvailPhysicalMemory();
/* */
/* */ public static native int GetTotalPagedMemory();
/* */
/* */ public static native int GetAvailPagedMemory();
/* */
/* */ public static native String GetPlatformID();
/* */
/* */ public static native int GetNumberOfProcessors();
/* */
/* */ public static native String GetProcessorType();
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\core\SystemInfo.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|