예제 #1
0
        public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
        {
            try
            {
                if (!args.ElapsedTime.Equals(TimeSpan.Zero))
                {
                    var flattenedArgs = args.FlattenStateArgs();

                    var metric = string.Format(testMetricInsert,
                                               testRunId,
                                               args.VirtualUser,
                                               args.PerfID,
                                               args.Description,
                                               args.StartTime,
                                               args.StopTime,
                                               args.ElapsedTime.TotalSeconds,
                                               flattenedArgs);
#if VERBOSE
                    TestTrace.Trace(metric);
#endif

                    using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
                    {
                        sqlCommand.CommandText = metric;
                        sqlCommand.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception e)
            {
                TestTrace.Trace(e.ToString());
            }
        }
        public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
        {
            string padding = getPadding(testObjectDictionary[testStepKey] + 1);

            using (StreamWriter sw = File.AppendText(resultFile))
            {
                sw.WriteLine($"{padding} TestMetric: {args.Description}, Elapsed time:  {args.ElapsedTime}");
            }
        }
        public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
        {
            if (!args.ElapsedTime.Equals(TimeSpan.Zero))
            {
                var flattenedArgs = args.FlattenStateArgs();

                var metric = string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}",
                                           args.VirtualUser, args.PerfID, args.Description,
                                           formatDateTime(args.StartTime),
                                           formatDateTime(args.StopTime),
                                           args.ElapsedTime.TotalSeconds,
                                           string.IsNullOrEmpty(flattenedArgs) ? "" : string.Format("\"{0}\"", flattenedArgs));

                _metricsContent.AppendLine(metric);
            }
        }
 public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
 {
     throw new NotImplementedException();
 }
 public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
 {
 }
 void TestMetric_OnTestMetric(string virtualUser, TestMetricEventArgs args)
 {
     //TestTrace.Trace(args.ToString());
 }
예제 #7
0
 private void TestMetric_OnTestMetric(string virtualUser, TestMetricEventArgs args)
 {
     _listenerEventsClient?.OnTestMetric(virtualUser, args);
 }
예제 #8
0
 public override void OnTestMetric(string virtualUser, TestMetricEventArgs args)
 {
     Debug.WriteLine("ExampleListener method:  " + MethodInfo.GetCurrentMethod().Name);
 }
예제 #9
0
 public abstract void OnTestMetric(string virtualUser, TestMetricEventArgs args);