public static async void Monitor(IndexOperations indexOperations) { var typeMonitors = new[] {"getEntry","searchEntry","errorEntry","indexEntry","logEntry"}; foreach (var typeMonitor in typeMonitors) { var monitorHandle = indexOperations.GetMonitorHandle("event_log", typeMonitor, "_timestamp"); monitorHandle.Action = PrintAction(typeMonitor); monitors.Add(monitorHandle); } var tasks = new List<Task>(); monitors.ForEach((handle => tasks.Add(handle.Run()))); await Task.WhenAll(tasks).ConfigureAwait(false); _logger.LogMessage("Complete"); }
static void Main(string[] args) { _logger = new ConsoleLogger(); var connectionPool = new List<string>() { "http://ess-01:9200" }; var settings = new ClientSettings(connectionPool,"event_log"); var client = new Client.Client(settings); GetStatusCode(client); var indexOperations = new IndexOperations(client); //Reindex(indexOperations); Monitor(indexOperations); System.Console.ReadLine(); //stop the monitors monitors.ForEach((m)=> m.Stop()); System.Console.ReadLine(); }
public static async void Reindex(IndexOperations indexOperations) { var result = await indexOperations.ReindexAsync("event_log", "getEntry"); _logger.LogMessage("Complete"); }
public MainWindow() { InitializeComponent(); IndexOperations = new IndexOperations(Client.Instance, this); ConsoleLoop().ConfigureAwait(true); }