mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Fix for Bug ACE-3373 Approx transaction indexing time remaining: being incorrect.
- node and acl estimates now use elapsed time - added estimated time to finish for content index based on elapsed time - time now include query, tracking loop, index commit and index warming amortized per unit of work (node, acl or content) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@89643 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
+82
@@ -47,6 +47,12 @@ public class TrackerStats
|
||||
ConcurrentHashMap<String, IncrementalStats> docTransformationTimes = new ConcurrentHashMap<String, IncrementalStats>();
|
||||
|
||||
ConcurrentHashMap<String, IncrementalStats> nodeTimes = new ConcurrentHashMap<String, IncrementalStats>();
|
||||
|
||||
ConcurrentHashMap<String, IncrementalStats> elapsedNodeTimes = new ConcurrentHashMap<String, IncrementalStats>();
|
||||
|
||||
ConcurrentHashMap<String, IncrementalStats> elapsedAclTimes = new ConcurrentHashMap<String, IncrementalStats>();
|
||||
|
||||
ConcurrentHashMap<String, IncrementalStats> elapsedContentTimes = new ConcurrentHashMap<String, IncrementalStats>();
|
||||
|
||||
private InformationServer infoSrv;
|
||||
|
||||
@@ -165,6 +171,21 @@ public class TrackerStats
|
||||
{
|
||||
return aggregateResults(nodeTimes).getMean();
|
||||
}
|
||||
|
||||
public double getMeanNodeElapsedIndexTime()
|
||||
{
|
||||
return aggregateResults(elapsedNodeTimes).getMean();
|
||||
}
|
||||
|
||||
public double getMeanAclElapsedIndexTime()
|
||||
{
|
||||
return aggregateResults(elapsedAclTimes).getMean();
|
||||
}
|
||||
|
||||
public double getMeanContentElapsedIndexTime()
|
||||
{
|
||||
return aggregateResults(elapsedContentTimes).getMean();
|
||||
}
|
||||
|
||||
public double getNodeIndexingThreadCount()
|
||||
{
|
||||
@@ -787,6 +808,66 @@ public class TrackerStats
|
||||
stats.add(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param docCount
|
||||
* @param l
|
||||
*/
|
||||
public void addElapsedNodeTime(int docCount, long time)
|
||||
{
|
||||
IncrementalStats stats = elapsedNodeTimes.get(Thread.currentThread().getName());
|
||||
if (stats == null)
|
||||
{
|
||||
stats = new IncrementalStats(TIME_SCALE, 50, this.infoSrv);
|
||||
elapsedNodeTimes.put(Thread.currentThread().getName(), stats);
|
||||
}
|
||||
long meanTime = time / docCount;
|
||||
for(int i = 0; i < docCount; i++)
|
||||
{
|
||||
stats.add(meanTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param docCount
|
||||
* @param l
|
||||
*/
|
||||
public void addElapsedAclTime(int docCount, long time)
|
||||
{
|
||||
IncrementalStats stats = elapsedAclTimes.get(Thread.currentThread().getName());
|
||||
if (stats == null)
|
||||
{
|
||||
stats = new IncrementalStats(TIME_SCALE, 50, this.infoSrv);
|
||||
elapsedAclTimes.put(Thread.currentThread().getName(), stats);
|
||||
}
|
||||
long meanTime = time / docCount;
|
||||
for(int i = 0; i < docCount; i++)
|
||||
{
|
||||
stats.add(meanTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param docCount
|
||||
* @param l
|
||||
*/
|
||||
public void addElapsedContentTime(int docCount, long time)
|
||||
{
|
||||
IncrementalStats stats = elapsedContentTimes.get(Thread.currentThread().getName());
|
||||
if (stats == null)
|
||||
{
|
||||
stats = new IncrementalStats(TIME_SCALE, 50, this.infoSrv);
|
||||
elapsedContentTimes.put(Thread.currentThread().getName(), stats);
|
||||
}
|
||||
long meanTime = time / docCount;
|
||||
for(int i = 0; i < docCount; i++)
|
||||
{
|
||||
stats.add(meanTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param size
|
||||
*/
|
||||
@@ -854,4 +935,5 @@ public class TrackerStats
|
||||
nodeTimes.clear();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user