コード例 #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}");
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);