public Task <string> RunTestAsync(string testName, int machines, int numberOfMethods, string expID, string rootKind = "Default")
        {
            var result = string.Empty;

            try
            {
                var analyzer       = SolutionAnalyzer.CreateFromTest(GrainClient.Instance, testName);
                var analysisClient = new AnalysisClient(analyzer, machines);

                //var results = await analysisClient.RunExperiment(GrainClient.GrainFactory, expID);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                analysisClient.StartRunningExperiment(GrainClient.GrainFactory, expID, Utils.ToAnalysisRootKind(rootKind));
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                //result = string.Format("Ready for queries. Time: {0} ms", results.ElapsedTime);
                result = string.Format("Running test {0}.", testName);
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }
                result = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }

            return(Task.FromResult(result));
        }
        protected void ButtonTestTest_Click(object sender, EventArgs e)
        {
            try
            {
                var testName = TextBoxPath.Text;
                var tokens   = TextRandomQueryInput.Text.Split(';');

                var className       = tokens[0];
                var methodPrejix    = tokens[1];
                var numberOfMethods = int.Parse(tokens[2]);
                var repetitions     = int.Parse(tokens[3]);
                var machines        = int.Parse(tokens[4]);

                var analyzer       = SolutionAnalyzer.CreateFromTest(GrainClient.Instance, testName);
                var analysisClient = new AnalysisClient(analyzer, machines);
                //var stopWatch = Stopwatch.StartNew();

                //var results = await analysisClient.RunExperiment(GrainClient.GrainFactory);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                analysisClient.StartRunningExperiment(GrainClient.GrainFactory);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                //stopWatch.Stop();
                Application["AnalysisClient"] = analysisClient;

                //this.TextBox1.Text = string.Format("Ready for queries. Time: {0} ms", results.ElapsedTime);
                this.TextBox1.Text = string.Format("Running test {0}.", testName);

                //Logger.LogInfo(GrainClient.Logger, "Stats", "Query", "Analyzing {0} took:{1} ms", testName, results.ElapsedTime);
                Logger.LogInfo(GrainClient.Logger, "Stats", "Query", "Analyzing {0}.", testName);

                //var result = await analysisClient.ComputeRandomQueries(className, methodPrejix, numberOfMethods, repetitions);

                //var result = await analysisClient.ComputeRandomQueries(repetitions);


                //program.RetriveInfoFromAnalysis();

                //System.Diagnostics.Trace.TraceInformation("Analyzing {0} took:{1} ms", testName, stopWatch.ElapsedMilliseconds);
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }
                this.TextBox1.Text = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }
        }