forked from ddrilling/AsbCloudServer
OperationDetectionBackgroundService remove statistic for optimization.
This commit is contained in:
parent
383e27d230
commit
d45145b8a5
@ -132,24 +132,13 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
|
||||
var startDate = begin;
|
||||
var detectedOperations = new List<DetectedOperation>(8);
|
||||
|
||||
var dbRequests_ = 0;
|
||||
var dbTime_ = 0d;
|
||||
var sw_ = new Stopwatch();
|
||||
var otherTime_ = 0d;
|
||||
|
||||
while (true)
|
||||
{
|
||||
sw_.Restart();
|
||||
var data = await query
|
||||
.Where(d => d.DateTime > startDate)
|
||||
.Take(take)
|
||||
.ToArrayAsync(token);
|
||||
|
||||
sw_.Stop();
|
||||
dbTime_ += sw_.ElapsedMilliseconds;
|
||||
dbRequests_++;
|
||||
sw_.Restart();
|
||||
|
||||
if (data.Length < minFragmentLength)
|
||||
break;
|
||||
|
||||
@ -182,16 +171,9 @@ namespace AsbCloudInfrastructure.Services.DetectOperations
|
||||
skip += minStepLength;
|
||||
}
|
||||
|
||||
sw_.Stop();
|
||||
otherTime_ += sw_.ElapsedMilliseconds;
|
||||
|
||||
if (!isDetected)
|
||||
{
|
||||
if (data.Length < take)
|
||||
break;
|
||||
|
||||
var lastPartDate = data.Last().DateTime;
|
||||
startDate = startDate + (0.75 * (lastPartDate - startDate));
|
||||
startDate = startDate.AddSeconds(0.95 * take);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user