/*========================================================================================= Main */
static void Main(string[] args)
{
_urlRequests = new List<int>();
foreach (var urlBase in Configuration.Urls)
{
_urlRequests.Add(0);
}
_maxUrlRequests = Configuration.Threads / Configuration.Urls.Count();
System.Net.ServicePointManager.DefaultConnectionLimit = 200;
_contentLeft = Configuration.FileProfile.Length;
for (int i = 0; i < Configuration.FolderProfile.Length; i++)
_contentLeft *= Configuration.FolderProfile[i];
DisplayConfiguration();
Console.Write("press enter to start...");
Console.ReadLine();
if (PerformanceCounterCategory.Exists("SenseNet Benchmark"))
PerformanceCounterCategory.Delete("SenseNet Benchmark");
try
{
InitializeCounterCategory();
InitializeCounters();
InitializeLogHeader();
}
catch (Exception ex)
{
Console.WriteLine();
Console.WriteLine("An error occured while initializing counters and log header:");
Console.WriteLine(ex.Message);
return;
}
Console.Write("Deleting " + Configuration.ContentRepositoryPath + "...");
var req = WebRequest.Create(String.Format("{0}?benchmarkaction=delete&snpath={1}", Configuration.Urls[0], Configuration.ContentRepositoryPath));
var resp = GetResponse(req);
if (resp.StatusCode != HttpStatusCode.OK)
{
Console.WriteLine();
Console.WriteLine("An error occured while initializing the server:");
Console.WriteLine(resp.Content);
return;
}
Console.WriteLine(" ok");
Logger.InitLogs();
//Email.InitEmail();
EnqueueTask(new RequestState
{
Id = _nextId++,
ContentTypeName = "Folder",
Level = 0,
SnPath = Configuration.ContentRepositoryPath
});
Run();
Logger.StopLogs();
Logger.FlushLogs();
if (Debugger.IsAttached)
{
Console.Write("Press enter to exit...");
Console.ReadLine();
}
if (PerformanceCounterCategory.Exists("SenseNet Benchmark"))
PerformanceCounterCategory.Delete("SenseNet Benchmark");
}