This is a brand new feature in TFS 2012 that hasn’t really been documented or talked about yet. If you’re a TFS administrator and you browse to this address on your server, you will see a new web-based administration interface for some things inside of TFS:
The first page that we see, is a view on the TFS Activity Log. Internally, TFS has two tables in the Tfs_Configuration and Tfs_CollectionX databases called tbl_Command and tbl_Parameter. This tables keep a record of every single command that every single user has executed against TFS for the last 14 days.
In this screenshot, you can see that the following columns are displayed:
- Command Id – A unique ID (per database) given to the command execution.
- Application – Which component of TFS does it relate to? Version Control, WorkItem Tracking, Framework, Lab Management, etc
- Command Name – The server name of the command. You can usually work out what the equivalent client/API call is – but these command names are not documented anywhere.
- Status – 0 = Success, –1 = Failure
- Start Time – When was the request first received by TFS
- Execution Time – How long did the command run for (Divide by 1,000,000 to get seconds)
- Identity Name – The user name of the user who executed the command
- IP Address – IPv4 or IPv6 address
- Unique Identifier – Used to group/correlate multiple server requests that originate from a single client request.
- User Agent – the ‘User-Agent’ HTTP Header from the client. Tells you the name of the executable if it’s using the TFS API and what version/SKU.
- Command Identifier – When using the TFS Command Line tools, this helps you correlate to what command the user was using. ‘tf get’, ‘tf edit’, etc.
- Execution Count – How many times was this command executed. The logging mechanism has some smarts to reduce the noise in the log. If you download a bazillion files, it doesn’t log a bazillion individual rows in the log. It just sets this value to a bazillion for that entry.
- Authentication Type – NTLM or Kerberos.
One of the things the TFS Activity Logger does, is that it logs the parameters passed in with a request when:
- The command fails (i.e. a status of != 0)
- Or, the command takes longer than 30 seconds
You can see these parameters by double-clicking a row in the table:
At the top of the Activity Log screen, you can also filter the log based upon Host/Collection and Identity Name. This is useful if a particular user complains about slow performance or TFS errors – you can easily look at the server logs to see what the server is seeing.
You can also click the ‘Export’ link to download a CSV file of the same content.
If you’d like to know more about how to query or interpret the contents of the TFS Activity Log – grab a copy of my Professional Team Foundation Server 2012 book and look at Chapter 23 – Monitoring Server Health and Performance.
TFS Job Monitoring
Built-in to TFS is the TFS Background Job Agent. This job agent is responsible for the scheduling and queuing of maintenance jobs and other jobs within TFS. You can see my blog post on all the different jobs in TFS 2012 for more information.
If we click the ‘Job Monitoring’ tab, we get some fairly ugly charts that give us some insight into how long the jobs are taking to execute.
There is another chart further down the ‘Job Summary’ page that shows us the number of times that a job has been run, and what was the status of each of those runs.
We can click on one of the green bars in that chart, or the blue bars in the previous chat, or the ‘Job History’ link in the navigation bar to see a different view of the TFS jobs.
This view shows us the number of jobs that were executing at a particular time, the average time that they waited in the job queue, and the average run time.
If you then click the ‘Job Queue’ link in the navigation bar, you can see which jobs are currently queued, their priorities and when they are expected to start.