Andover is a .NET framework for monitoring and examining Sitecore implementations against documented best practices.
Andover consists of Categories from which statistics are gathered and summarized. Categories contain one or more components, each mapping to a measurable configuration setting within Sitecore.
Follow the steps below to integrate into a Sitecore installation:- Install NuGet Package: https://www.nuget.org/packages/Andover/
- Modify any config settings specific to your Sitecore install withi App_Config\Include\Andover.config
- Browse \tools\analysis.aspx
Andover consists of the following projects:
- Andover.Controller - Ties everything together through references to both Andover.Domain and Andover.Data.
- Andover.Domain - Rules from which analysis is conducted.
- Andover.Data - Data providers used by Andover.Domain to run analysis against.
Andover.Controller is the glue for the solution. Its main responsibilities are:
- Gathers settings from the main Analyzer page and distributes across projects.
- Instantiates Providers and injects them into Components within Andover.Domain.
- Categories are instantiated and linked to Components, also within Andover.Domain
Andover.Domain contains all the rules from which analysis is conducted. The Domain Model design pattern is used here to eliminate any and all dependencies. Looking at the project references, notice how it's lightweight for library dependencies:
Interfaces provide shells to code against, while at run time, Andover.Controller injects dependencies into the framework. Looking at the overall solution structure, notice how dependencies exist for all projects except for Andover.Domain (highlighted in yellow):
The example below outlines how to add a component, component result, and data provider.
In Andover.Domain, Create an interface for your provider
namespace Andover.Domain.Components.Cache.Provider
{
public interface ICacheProvider
{
// Returns data analysis results
IEnumerable<CacheDelta> GetAllSitecoreCaches(int deltaThresholdPercentage);
}
}
In Andover.Data, create your provider, implementing your interface above and deriving from ProviderBase. Your class will resemble the following:
namespace Andover.Data.Cache.Provider
{
public class CacheProvider : ProviderBase, ICacheProvider
{
public override void DisposeProvider()
{
// dispose provider logic
}
public IEnumerable<CacheDelta> GetAllSitecoreCaches(int deltaThresholdPercentage)
{
// pull source of component analysis here
}
}
}
Create your component class, implementing IComponent and deriving from ComponentBase.
namespace Andover.Domain.Components.Cache
{
public class CacheComponent : ComponentBase, IComponent
{
private ICacheProvider _provider;
public CacheComponent(ICacheProvider provider)
{
_provider = provider;
}
public override IEnumerable<IComponentResult> Analyze()
{
// perform analysis on data in provider
}
public bool IsCompliant
{
get
{
// logic to determine if component is compliant
}
}
}
}
Create your results, deriving from ComponentResultBase. Providing both member attributes ComponentResultName and ComponentResultDescription ensures results are properly labeled within the report.
namespace Andover.Domain.Components.Cache.Results
{
public class CacheDelta : ComponentResultBase
{
[ComponentResultName("Size"),
ComponentResultDescription("Cache delta size")]
public long Size { get; set; }
[ComponentResultName("Maximum Size"),
ComponentResultDescription("Maximum size of cache delta")]
public long MaxSize { get; set; }
[ComponentResultName("Remaining Space"),
ComponentResultDescription("Remaining space before reaching threshold")]
public long RemainingSpace { get; set; }
[ComponentResultName("Beyond Threshold"),
ComponentResultDescription("Determines if cache delta is beyond threshold")]
public bool IsDeltaPastThreshold { get; set; }
[ComponentResultName("Cache Name"),
ComponentResultDescription("Cache Setting Name")]
public string CacheName { get; set; }
}
}
Update Andover.Config within Andover.Domain for any settings required:
<category name="Cache Settings" description="Cache setting analysis" >
<components>
<component type="Andover.Domain.Components.Cache.CacheDeltasComponent" name="Cache Deltas" description="Cache delta analysis" />
</components>
</category>
In Andover.Controller, update ProviderModule.cs to bind and map your new provider
namespace Andover.Controller
{
public class ProviderModule : NinjectModule
{
// append provider wire-up here
public override void Load()
{
Bind<ICacheProvider>()
.To<CacheProvider>();
...
When complete, your folder structure should match the following:
- Sitecore cache thresholds & deltas
- Sitecore logs
- Application start-up frequency
- Soft crashes
- Hard crashes
- Application Error counts
- Long running requests frequency
- Application start-up frequency
- Configuration settings
- Content tree structure
- Number of versions per item
- Number of items per parent
- Sitecore database health
- Artifacts Cleanup
- History table
- PublishQueue table
- EventQueue table
- Database index fragmentation
- Database consistency errors
- Artifacts Cleanup
- Sitecore DMS configuration
- Database index fragmentation
- Robot traffic
- Max Queue Size
- Andover - Reporting and analysis of Sitecore vital statistics.
- Category - Collection of common Sitecore settings or components.
- Component - A single Sitecore setting to monitor.
- Andover Compliance Score - Best Practice Compliance Score.