I think that my next few posts will be about the Team Foundation Server Data Warehouse, so I wanted to do a post about how to update this warehouse on demand.
The Team Foundation Server Data Warehouse updates itself every couple of hours by default. This process involves running all of the registered data adapters and processing the cube. As you store more and more data, this can become a very CPU-intensive operation. That is why the warehouse only updates every couple of hours by default. In most cases, having your reports current within a couple of hours is sufficient.
However, there are times when you want to update the warehouse on demand. Maybe you’re giving a demonstration, or maybe you’re debugging an adapter you’ve written or maybe you just need the most up to date method.
Updating the warehouse on demand is pretty straightforward – you can use the corresponding warehouse XML Web Service to kick off a run. This is an async operation though, so you’ll need to poll on its status. The two web methods you’ll need are shown below:
What makes this process a little tedious is that you have to keep invoking GetWarehouseStatus until it returns a status of Idle.
To make this a little easier, I thought I would write a small utility to kick off the run and monitor its status for me. This little utility is shown below:
Once you select the right TFS, press the Update button and the utility should take care of kicking off a run and polling until the warehouse is idle again. I posted the source here, please give it a try and let me know what you think.