-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
48 lines (43 loc) · 1.67 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using StressTestPoc.Common.Helper;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Xml;
namespace StressTestPoc {
class Program {
public static string containerName;
public static async Task Main(string[] args) {
XmlDocument log4netConfig = new XmlDocument();
log4netConfig.Load(File.OpenRead("log4net.config"));
var repo = log4net.LogManager.CreateRepository(Assembly.GetEntryAssembly(),
typeof(log4net.Repository.Hierarchy.Hierarchy));
log4net.Config.XmlConfigurator.Configure(repo, log4netConfig["log4net"]);
#region "New Start"
Console.WriteLine("<MainStart>");
DoWorker doWorker;
Console.WriteLine("How many thread you want to start?:");
int threadcount = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("How many work you want to do?:");
int actualWorkCount = Convert.ToInt32(Console.ReadLine());
doWorker = new DoWorker(threadcount, actualWorkCount);
// Create new stopwatch.
Stopwatch stopwatch = new Stopwatch();
// Begin timing.
stopwatch.Start();
try {
doWorker.DoWork();
} catch(Exception ex) {
Logger.Error("From Main", ex);
}
// Stop timing.
stopwatch.Stop();
Logger.Info("TakenTime: " + stopwatch.Elapsed.ToString());
Logger.Info("</MainStart>");
Console.ReadLine();
#endregion
Console.ReadKey();
}
}
}