This text file contains example code from: Chapter 20 - SOA Metrics with BAM Book - SOA with .NET & Windows Azure: Realizing Service-Orientation with the Microsoft Platform Series - Prentice Hall Service-Oriented Computing Series from Thomas Erl (www.soabooks.com/community) Certification - These examples are used as part of the Certified SOA .NET Developer curriculum (www.soaschool.com) <programlisting linenumbering="unnumbered">public class ServiceTracker { const string ACTIVITY_NAME = "CommonServiceMetrics"; const string CONNECTION_STRING = "Integrated Security=SSPI;Persist Security Info=False; Initial Catalog=BizTalkMsgBoxDb"; public static Guid TrackServiceStart (string serviceName, string methodName, string client) { return TrackServiceStart(serviceName, methodName, client, ""); } public static Guid TrackServiceStart (string serviceName, string methodName, string client, string methodDetails) { Guid guid = Guid.NewGuid(); BufferedEventStream strm = new BufferedEventStream(); strm.ConnectionString = CONNECTION_STRING; strm.BeginActivity(ACTIVITY_NAME, guid.ToString()); strm.UpdateActivity(ACTIVITY_NAME, guid.ToString(), "SvcStart", DateTime.Now, "SvcName", serviceName, "SvcMethod", methodName, "SvcClient", client, "SvcMethodDetail", methodDetails); strm.Flush(); return guid; } }</programlisting> </example>