Skip to content

Commit

Permalink
Pushed [TIME] profiling to Trace
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Dec 14, 2024
1 parent 691f810 commit 9bd50ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions API/Services/Tasks/Scanner/ProcessSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private async Task UpdateSeriesMetadata(Series series, Library library)
var personSw = Stopwatch.StartNew();
var chapterPeople = chapters.SelectMany(c => c.People.Where(p => p.Role == PersonRole.Writer)).ToList();
await UpdateSeriesMetadataPeople(series.Metadata, series.Metadata.People, chapterPeople, PersonRole.Writer);
_logger.LogDebug("[TIME] Kavita took {Time} ms to process writer on Series: {File} for {Count} people", personSw.ElapsedMilliseconds, series.Name, chapterPeople.Count);
_logger.LogTrace("[TIME] Kavita took {Time} ms to process writer on Series: {File} for {Count} people", personSw.ElapsedMilliseconds, series.Name, chapterPeople.Count);
}

if (!series.Metadata.ColoristLocked)
Expand Down Expand Up @@ -457,7 +457,7 @@ private async Task UpdateCollectionTags(Series series, Chapter firstChapter)
await _unitOfWork.CollectionTagRepository.UpdateCollectionAgeRating(collectionTag);
}

_logger.LogDebug("[TIME] Kavita took {Time} ms to process collections on Series: {Name}", sw.ElapsedMilliseconds, series.Name);
_logger.LogTrace("[TIME] Kavita took {Time} ms to process collections on Series: {Name}", sw.ElapsedMilliseconds, series.Name);
}


Expand Down Expand Up @@ -918,7 +918,7 @@ private async Task UpdateChapterFromComicInfo(Chapter chapter, ComicInfo? comicI
var personSw = Stopwatch.StartNew();
var people = TagHelper.GetTagValues(comicInfo.Writer);
await UpdateChapterPeopleAsync(chapter, people, PersonRole.Writer);
_logger.LogDebug("[TIME] Kavita took {Time} ms to process writer on Chapter: {File} for {Count} people", personSw.ElapsedMilliseconds, chapter.Files.First().FileName, people.Count);
_logger.LogTrace("[TIME] Kavita took {Time} ms to process writer on Chapter: {File} for {Count} people", personSw.ElapsedMilliseconds, chapter.Files.First().FileName, people.Count);
}

if (!chapter.EditorLocked)
Expand Down Expand Up @@ -987,7 +987,7 @@ private async Task UpdateChapterFromComicInfo(Chapter chapter, ComicInfo? comicI
await UpdateChapterTags(chapter, tags);
}

_logger.LogDebug("[TIME] Kavita took {Time} ms to create/update Chapter: {File}", sw.ElapsedMilliseconds, chapter.Files.First().FileName);
_logger.LogTrace("[TIME] Kavita took {Time} ms to create/update Chapter: {File}", sw.ElapsedMilliseconds, chapter.Files.First().FileName);
}

private async Task UpdateChapterGenres(Chapter chapter, IEnumerable<string> genreNames)
Expand Down
4 changes: 2 additions & 2 deletions API/Services/Tasks/ScannerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ await _eventHub.SendMessageAsync(MessageFactory.Error,
// Process Series
var seriesProcessStopWatch = Stopwatch.StartNew();
await _processSeries.ProcessSeriesAsync(parsedSeries[pSeries], library, seriesLeftToProcess, bypassFolderOptimizationChecks);
_logger.LogDebug("[TIME] Kavita took {Time} ms to process {SeriesName}", seriesProcessStopWatch.ElapsedMilliseconds, parsedSeries[pSeries][0].Series);
_logger.LogTrace("[TIME] Kavita took {Time} ms to process {SeriesName}", seriesProcessStopWatch.ElapsedMilliseconds, parsedSeries[pSeries][0].Series);
seriesLeftToProcess--;
}

Expand Down Expand Up @@ -644,7 +644,7 @@ private async Task<int> ProcessParsedSeries(bool forceUpdate, Dictionary<ParsedS
totalFiles += pSeries.Value.Count;
var seriesProcessStopWatch = Stopwatch.StartNew();
await _processSeries.ProcessSeriesAsync(pSeries.Value, library, seriesLeftToProcess, forceUpdate);
_logger.LogDebug("[TIME] Kavita took {Time} ms to process {SeriesName}", seriesProcessStopWatch.ElapsedMilliseconds, pSeries.Value[0].Series);
_logger.LogTrace("[TIME] Kavita took {Time} ms to process {SeriesName}", seriesProcessStopWatch.ElapsedMilliseconds, pSeries.Value[0].Series);
seriesLeftToProcess--;
}

Expand Down

0 comments on commit 9bd50ca

Please sign in to comment.