public static void RunSomeRequests() { var test = new SampleMetrics(); var tasks = new List<Thread>(); for (var i = 0; i < 10; i++) { var j = i; tasks.Add(new Thread(() => test.Request(j))); } tasks.ForEach(t => t.Start()); tasks.ForEach(t => t.Join()); }
public static void RunSomeRequests() { var test = new SampleMetrics(); var tasks = new List <Thread>(); for (var i = 0; i < 10; i++) { var j = i; tasks.Add(new Thread(() => test.Request(j))); } tasks.ForEach(t => t.Start()); tasks.ForEach(t => t.Join()); }
static void Main(string[] args) { Metric.Config .WithErrorHandler(x => System.Console.WriteLine(x.ToString())) //.WithAllCounters() .WithReporting(config => config .WithMetricsLog4NetConfiguration(new MetricsLog4NetConfiguration() .WithRegionalCsvDelimiter() .SetLogDirectory(@".\metrics\") .ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\Metrics.Log4Net.config")) //or .UseDefaultConfiguration() ) .WithLog4NetCsvReport(TimeSpan.FromSeconds(5)) .WithLog4NetTextReport(TimeSpan.FromSeconds(5)) .WithConsoleReport(TimeSpan.FromSeconds(5)) ); SampleMetrics.RunSomeRequests(); System.Console.WriteLine("done setting things up"); System.Console.ReadKey(); }