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