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:
Andover consists of the following projects:
Andover.Controller is the glue for the solution. Its main responsibilities are:
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: