@@ -1624,21 +1624,30 @@ private static class
1624
1624
1625
1625
private long processMaxMS = 0 ;
1626
1626
1627
- private long processLastComplete = 0 ;
1627
+ private long processLastCompleteMono = - 1 ;
1628
1628
1629
1629
private long processTotalGap = 0 ;
1630
1630
1631
1631
private long processTotalRecalcs = 0 ;
1632
1632
1633
1633
private long processTotalZeroRecalcs = 0 ;
1634
1634
1635
+ private long lastDebugNoChangesMono = -1 ;
1636
+
1635
1637
protected void process () {
1636
- long now = 0 ;
1638
+ long nowMono = - 1 ;
1637
1639
try {
1638
1640
this_mon .enter ();
1639
1641
1640
- now = SystemTime .getCurrentTime ();
1642
+ nowMono = SystemTime .getMonotonousTime ();
1641
1643
1644
+ boolean debugNoChange = lastDebugNoChangesMono == -1 || nowMono - lastDebugNoChangesMono >= 60000 ;
1645
+
1646
+ if ( debugNoChange ){
1647
+
1648
+ lastDebugNoChangesMono = nowMono ;
1649
+ }
1650
+
1642
1651
somethingChanged = false ;
1643
1652
Object [] recalcArray ;
1644
1653
try {
@@ -1653,10 +1662,15 @@ protected void process() {
1653
1662
DefaultRankCalculator rankObj = (DefaultRankCalculator ) recalcArray [i ];
1654
1663
if (bDebugLog ) {
1655
1664
long oldSR = rankObj .getSeedingRank ();
1665
+
1656
1666
rankObj .recalcSeedingRank ();
1657
- String s = "recalc seeding rank. old/new=" + oldSR + "/"
1658
- + rankObj .getSeedingRank ();
1659
- log .log (rankObj .getRelatedTo (), LoggerChannel .LT_INFORMATION , s );
1667
+
1668
+ int newSR =rankObj .getSeedingRank ();
1669
+
1670
+ if ( oldSR != newSR ){
1671
+ String s = "recalc seeding rank. old/new=" + oldSR + "/" + newSR ;
1672
+ log .log (rankObj .getRelatedTo (), LoggerChannel .LT_INFORMATION , s );
1673
+ }
1660
1674
} else {
1661
1675
rankObj .recalcSeedingRank ();
1662
1676
}
@@ -1939,7 +1953,7 @@ protected void process() {
1939
1953
tvars = temp .toArray (new ProcessTagVarsComplete [temp .size ()]);
1940
1954
}
1941
1955
1942
- handleCompletedDownload ( dlData , vars , tvars , totals );
1956
+ handleCompletedDownload ( dlData , vars , tvars , totals , debugNoChange );
1943
1957
}
1944
1958
} // Loop 2/2 (Start/Stopping)
1945
1959
@@ -2024,20 +2038,20 @@ protected void process() {
2024
2038
"freeS=" + lightSeedingSlots , "" , true , null );
2025
2039
}
2026
2040
} finally {
2027
- if (now > 0 ) {
2041
+ if (nowMono >= 0 ) {
2028
2042
processCount ++;
2029
- long timeTaken = (SystemTime .getCurrentTime () - now );
2043
+ long timeTaken = (SystemTime .getMonotonousTime () - nowMono );
2030
2044
if (bDebugLog ) {
2031
2045
log .log (LoggerChannel .LT_INFORMATION , "process() took " + timeTaken );
2032
2046
}
2033
2047
processTotalMS += timeTaken ;
2034
2048
if (timeTaken > processMaxMS ) {
2035
2049
processMaxMS = timeTaken ;
2036
2050
}
2037
- if (processLastComplete > 0 ) {
2038
- processTotalGap += (now - processLastComplete );
2051
+ if (processLastCompleteMono >= 0 ) {
2052
+ processTotalGap += (nowMono - processLastCompleteMono );
2039
2053
}
2040
- processLastComplete = now ;
2054
+ processLastCompleteMono = nowMono ;
2041
2055
}
2042
2056
2043
2057
immediateProcessingScheduled = false ;
@@ -2805,7 +2819,8 @@ protected void process() {
2805
2819
DefaultRankCalculator dlData ,
2806
2820
ProcessVars vars ,
2807
2821
ProcessTagVarsComplete [] tagVars ,
2808
- TotalsStats totals )
2822
+ TotalsStats totals ,
2823
+ boolean debugNoChange )
2809
2824
{
2810
2825
if (!totals .bOkToStartSeeding )
2811
2826
return ;
@@ -3449,7 +3464,7 @@ else if (!bActivelySeeding && bSeeding)
3449
3464
"nSeeds=" + dlData .getLastModifiedScrapeResultSeeds (),
3450
3465
"nPeers=" + dlData .getLastModifiedScrapeResultPeers ()
3451
3466
};
3452
- printDebugChanges ("" , debugEntries , debugEntries2 , sDebugLine , " " , true , dlData );
3467
+ printDebugChanges ("" , debugEntries , debugEntries2 , sDebugLine , " " , debugNoChange , dlData );
3453
3468
}
3454
3469
}
3455
3470
}
0 commit comments