private static List<Object> GenerateProcessTrainingData() { var rand = new Random(); ProcessDataPoint dataPoint; var dataPoints = new List<Object>(); string[] processNames = { "notepad.exe", "VisualStudio.exe" }; string processName; int type; string ramUsage = ""; DateTime time; /* //generate 25 process names for (int i = 0; i < 25; i++) { processNames[i] = "process" + i; } */ for (int i = 0; i < 10000; i++) { type = rand.Next(4); if (rand.Next(2) == 1) { ramUsage = (rand.Next(50, 200)).ToString(); processName = processNames[0]; } else { ramUsage = (rand.Next(600, 1000)).ToString(); processName = processNames[1]; } time = RandomTimeEightToEleven(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); } for (int i = 0; i < 10000; i++) { type = rand.Next(4); ramUsage = (rand.Next(50, 200)).ToString(); processName = processNames[0]; time = RandomTimeOneToFour(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); } return dataPoints; }
private static List<Object> GenerateProcessAnomalyData() { var rand = new Random(); ProcessDataPoint dataPoint; var dataPoints = new List<Object>(); string[] processNames = { "VisualStudio.exe", "notepad.exe", "virus.txt", "steam.exe" }; string processName; int type; string ramUsage = ""; DateTime time; for (int i = 0; i < 5; i++) { type = rand.Next(4); if (rand.Next(2) == 1) { ramUsage = (rand.Next(50, 200)).ToString(); processName = processNames[0]; } else { ramUsage = (rand.Next(600, 1000)).ToString(); processName = processNames[1]; } time = RandomTimeEightToEleven(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); } for (int i = 0; i < 5; i++) { processName = processNames[rand.Next(4)]; type = rand.Next(4); ramUsage = (rand.Next(50, 200)).ToString(); time = RandomTimeOneToFour(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); } processName = processNames[rand.Next(4)]; type = rand.Next(4); ramUsage = 364.ToString(); time = RandomDateTimeEightToFive(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); processName = processNames[rand.Next(4)]; type = rand.Next(4); ramUsage = 250.ToString(); time = RandomTimeEightToEleven(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); processName = processNames[rand.Next(4)]; type = rand.Next(4); ramUsage = 700.ToString(); time = RandomTimeOneToFour(rand); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); processName = processNames[rand.Next(4)]; type = rand.Next(4); ramUsage = 100.ToString(); time = new DateTime(2016, 4, 29, 12, 00, 00); dataPoint = new ProcessDataPoint(processName, type, time, ramUsage); dataPoints.Add(dataPoint.AsDataObject()); return dataPoints; }