Example #1
0
        public static void BeginRegister(CounterInfo counterInfo, string userHandle = null, IDictionary <string, string> data = null, Action <RegisterCompleteEventArgs> completeAction = null)
        {
            counterInfo.End();

            if (!Configuration.Enabled)
            {
                return;
            }
            BeginRegisterEx(counterInfo.Message, counterInfo.Checkpoints.ToList(), userHandle, data, completeAction);
        }
Example #2
0
        public static CounterResponse Register(CounterInfo counterInfo, string userHandle = null, IDictionary <string, string> data = null)
        {
            counterInfo.End();

            if (!Configuration.Enabled)
            {
                return(null);
            }

            var response = RegisterEx(counterInfo.Message, counterInfo.Checkpoints.ToList(), userHandle, data, null);

            if (!response.Success)
            {
                throw new InvalidOperationException("Unable to register counter. Look at inner exception for details.", response.Exception);
            }

            return(response.CounterResponse);
        }
 public static async Task <CounterResponse> RegisterAsync(CounterInfo counterInfo, string userHandle = null, IDictionary <string, string> data = null)
 {
     return(await Task <CounterResponse> .Factory.StartNew(() => Register(counterInfo, userHandle, data)));
 }
 public void Step(CounterInfo subCounter)
 {
     _subCounters.Add(subCounter);
 }
Example #5
0
 public static void Checkpoint(CounterInfo counterInfo, string message)
 {
     counterInfo.Step(message);
 }