Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 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)));
 }
Esempio n. 4
0
 public void Step(CounterInfo subCounter)
 {
     _subCounters.Add(subCounter);
 }
Esempio n. 5
0
 public static void Checkpoint(CounterInfo counterInfo, string message)
 {
     counterInfo.Step(message);
 }