SenseAdapt Cache Prime

Introduction

SenseAdapt Cache Prime is a program that runs on your SenseAdapt Server to populate the SenseAdapt Cache.

The best way to run the application, is from a Windows Scheduler with it timed to populate the SenseAdapt Cache early in the morning at a time when no one is using the SenseAdapt Server. The benefits are, that the user gets a much faster experience when using SenseAdapt in the morning as the application has primed the cache with data ready for the next day.

SenseAdapt Cache Prime can cache the following data to make SenseAdapt faster.

  • Lists of Collections, Projects, Teams, Tags, Item Types, Area Paths and Iterations. Because SenseAdapt stores these locally it no longer needs to call TFS or Jira each time it needs to get this data so should put less strain on TFS and make SenseAdapt much faster.
  • History Data is now collected by SenseAdapt Cache Prime which reduces load on the TFS or Jira server and speeds up the rendering of charts.
  • PreCaching saved BurnUpCharts. Sense Adapt Cache Prime can precollect data for BurnUpCharts so they are faster to load in the mornings.

How does it work?

SenseAdapt Cache Prime can be called with 3 arguments in the following way

   SenseAdaptCachePrime.exe updatefiltering=true chartRefresh=false updatehistory=true


updatefiltering
When set to true this setting tells SenseAdapt to cache

  • Collections drop down list(TFS only)
  • Projects drop down list
  • Iterations in TFS (or Components in Jira)
  • Area Paths in TFS (or Releases in Jira)
  • Work item Types in TFS (or Issue Types in Jira)
  • Tags in TFS (or Lables in Jira)
  • Team in TFS

If you regularly update the above listed objects throughout the day. You can call SenseAdapt CachePrime with only this flag set and schedule the program to run every hour.

chartRefresh
This setting will find any saved BurnUps and pre-save the data that is used to create them, making the charts load very fast. It is recommended that this setting is used early in the morning before users start to use SenseAdapt.

updatehistory This goes and gets the historic data needed to render charts. It is recommended to run this early in the morning before users use SenseAdapt. The calls to updatehistory can be quite slow the first time you run SenseAdapt Cache Prime will be the longest as it collects the first amount of data. For example collecting 6 months worth of data depending on the speed of your TFS or Jira system could take 5 minutes to 30 minutes depending on the amount of data and users on the system.


SenseAdapt Cache Prime works by looking through all the charts you have saved. It then works its way through each of these charts and loads the data needed for them. Basically if you wish to see a faster version of a chart the best thing to do is to save the chart and SenseAdapt Cache Prime will find it and load the data for it.

How to install it

SenseAdapt Cache Prime has a configuration file that will need to be located with the application. Cache Prime is run from the bin folder of SenseAdapt iteself. The following are the parameters that will need to be set.

<appSettings>
     <!-- These are login details used to access your SenseAdapt Server -->
    <!-- If you do not need to log into your SenseAdapt Server you can leave the username and password blank -->
    <!-- If the app requires a login it will attempt to use the AD or NT account the app is running under -->
    <add key="username" value="username"/>
    <add key="password" value="password"/>
    <add key="domain" value=""/>

    <!-- This is the url to your SenseAdapt server -->
    <add key="senseAdaptServerUrl" value="http://localhost/"/>
    
    
    <!-- Set this setting if you wish SenseAdapt to delete the cache before populating it each time -->
    <!-- Warning: It is not advisable to use this setting when running this program when the system is at its busiest -->
    <!-- as users will experience a drop in performance. This setting should be used for out of hours -->

    <add key="deleteCacheBeforePopulate" value="false"/>


    <!-- These are the TFS projects you wish SenseAdapt to cache list each project in a comma separated list with no spaces ie acme project 1,acme project 2,acme project 3-->
    <add key="projectsToUse" value="visualisation"/>

   <!-- These are the TFS collections you wish SenseAdapt to check for projects in a comma separated list -->
    <add key="collectionsToUse" value="ripplertest"/>

    <!-- These are the work item types you wish SenseAdapt to cache in a comma separated list. SenseAdapt will ignore any work item types that are not listed.  -->
    <add key="workItemTypes" value="Product BackLog Item,Task"/>

    <!-- These are the work item types you wish to include child links to. Product Backlog Item for example would have links to Tasks which are used in some charts -->
    <add key="workItemsToIncludeLinksFor" value="Product Backlog Item"/>
    

    <!-- This is how much cache data you wish SenseAdapt to collect. The more you collect the faster SenseAdapt should be when rendering charts. -->
    <add key="monthsToGoBack" value="6"/>
    
    <!-- If you would like SenseAdapt to delay each time it reads for data from TFS you can put a delay in here so it waits between each call -->
    <!--This is the delay to place in between ASOF call for data-->
    <add key="delayBetweenCalls" value="0"/>
  </appSettings>
  • username and password - are the user name and password you use to access SenseAdapt from its web interface. If you do not have security configured for this SenseAdapt will use the credentials of the user that SenseAdapt Cache Prime is run under. You can choose which one this is if you run SenseAdapt a Windows Task Scheduler task.
  • senseAdaptServerUrl - this is the url to the SenseAdapt Server without the leading "/" so for example http://mysenseadaptserver
  • deleteCacheBeforePopulate - Set this setting to get SenseAdapt to delete the cache entirely before populating it. This is a good idea to keeps its integrity but only recommended when the system is not being used as there is a performance cost when SenseAdapt rebuilds the cache.


Running for the first time

SenseAdapt Cache Prime should be run manually for the first time with the following parameters. This will cache items that take a while to run from SenseAdapt, such as the iterations paths, areapaths, tags, teams and projects.

   SenseAdaptCachePrime.exe updatefiltering=true chartRefresh=false updatehistory=false


Logging

SenseAdapt Cache Prime supports logging. To enable logging, make a copy of the NLOG.config file found in the root of the SenseAdapt website and place this in the bin folder with SenseAdaptCachePrime.exe then follow the instructions found here Logging

Best Practice

Updating the cache It is recommended that this program is run using a windows task scheduler at a time when the system is not being used. Possibly in the early morning with the following flags set. Please note the first time the cache is updated will be the slowest, after the first time the cache should only update with the latest days data.

   SenseAdaptCachePrime.exe updatefiltering=true chartRefresh=false updatehistory=true

Frequently through the day If you are constantly adding iteration paths, area paths and projects to your collection you may want to run the cache program with only the updatefiltering flag set to true very 1 to 2 hrs.

   SenseAdaptCachePrime.exe updatefiltering=true chartRefresh=false updatehistory=false