using TightWiki.Engine.Library.Interfaces;
using TightWiki.Models;
using TightWiki.Repository;
namespace TightWiki.Engine.Implementation
{
///
/// Handles wiki completion events.
///
public class CompletionHandler : ICompletionHandler
{
///
/// Handles wiki completion events. Is called when the wiki processing competes for a given page.
///
/// Reference to the wiki state object
public void Complete(ITightEngineState state)
{
if (GlobalConfiguration.RecordCompilationMetrics)
{
StatisticsRepository.InsertCompilationStatistics(state.Page.Id,
state.ProcessingTime.TotalMilliseconds,
state.MatchCount,
state.ErrorCount,
state.OutgoingLinks.Count,
state.Tags.Count,
state.HtmlResult.Length,
state.Page.Body.Length);
}
}
}
}