@@ -69,14 +69,29 @@ public class PerformanceMetrics {
6969 */
7070 PerformanceMetric excessSleep ;
7171
72+ /**
73+ * Instances of System.nanoTime() measuring a longer frame duration with respect to WinAPI's GetTickCount.
74+ */
75+ PerformanceMetric positiveTimeDelta ;
76+
77+ /**
78+ * Instances of System.nanoTime() measuring a shorter frame duration with respect to WinAPI's GetTickCount.
79+ */
80+ PerformanceMetric negativeTimeDelta ;
81+
82+ /**
83+ * When Kernel32.INSTANCE.GetTickCount() returns at least one inexplicable value
84+ */
85+ PerformanceMetric weirdTimeDelta ;
86+
7287 private BWClientConfiguration configuration ;
7388
7489 PerformanceMetrics (BWClientConfiguration configuration ) {
7590 this .configuration = configuration ;
7691 reset ();
7792 }
7893
79- void reset () {
94+ public void reset () {
8095 totalFrameDuration = new PerformanceMetric ("JBWAPI frame duration" , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 55 , 85 );
8196 copyingToBuffer = new PerformanceMetric ("Time copying to buffer" , 5 , 10 , 15 , 20 , 25 , 30 );
8297 intentionallyBlocking = new PerformanceMetric ("Blocking with full buffer" , 0 );
@@ -88,21 +103,27 @@ void reset() {
88103 botIdle = new PerformanceMetric ("Bot idle" , Long .MAX_VALUE );
89104 clientIdle = new PerformanceMetric ("Client idling" , configuration .maxFrameDurationMs );
90105 excessSleep = new PerformanceMetric ("Excess sleep" , 1 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 55 , 85 );
106+ positiveTimeDelta = new PerformanceMetric ("Positive timer delta" , 1 , 2 , 3 , 4 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 55 , 85 );
107+ negativeTimeDelta = new PerformanceMetric ("Negative timer delta" , 1 , 2 , 3 , 4 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 55 , 85 );
108+ weirdTimeDelta = new PerformanceMetric ("Weird timer delta" );
91109 }
92110
93111 @ Override
94112 public String toString () {
95113 return "Performance metrics:"
96- + "\n " + totalFrameDuration .toString ()
97- + "\n " + copyingToBuffer .toString ()
98- + "\n " + intentionallyBlocking .toString ()
99- + "\n " + frameBufferSize .toString ()
100- + "\n " + framesBehind .toString ()
101- + "\n " + flushSideEffects .toString ()
102- + "\n " + botResponse .toString ()
103- + "\n " + bwapiResponse .toString ()
104- + "\n " + botIdle .toString ()
105- + "\n " + clientIdle .toString ()
106- + "\n " + excessSleep .toString ();
114+ + "\n " + totalFrameDuration .toString ()
115+ + "\n " + copyingToBuffer .toString ()
116+ + "\n " + intentionallyBlocking .toString ()
117+ + "\n " + frameBufferSize .toString ()
118+ + "\n " + framesBehind .toString ()
119+ + "\n " + flushSideEffects .toString ()
120+ + "\n " + botResponse .toString ()
121+ + "\n " + bwapiResponse .toString ()
122+ + "\n " + botIdle .toString ()
123+ + "\n " + clientIdle .toString ()
124+ + "\n " + excessSleep .toString ()
125+ + "\n " + positiveTimeDelta .toString ()
126+ + "\n " + negativeTimeDelta .toString ()
127+ + "\n " + weirdTimeDelta .toString ();
107128 }
108129}
0 commit comments