public virtual void TestSingleEntryDataStatistics()
        {
            DataStatistics statistics = new DataStatistics(17.29);

            NUnit.Framework.Assert.AreEqual(1, statistics.Count(), Tol);
            NUnit.Framework.Assert.AreEqual(17.29, statistics.Mean(), Tol);
            NUnit.Framework.Assert.AreEqual(0, statistics.Var(), Tol);
            NUnit.Framework.Assert.AreEqual(0, statistics.Std(), Tol);
            NUnit.Framework.Assert.AreEqual(17.29, statistics.Outlier(1.0f), Tol);
        }
        public virtual void TestMutiEntryDataStatistics()
        {
            DataStatistics statistics = new DataStatistics();

            statistics.Add(17);
            statistics.Add(29);
            NUnit.Framework.Assert.AreEqual(2, statistics.Count(), Tol);
            NUnit.Framework.Assert.AreEqual(23.0, statistics.Mean(), Tol);
            NUnit.Framework.Assert.AreEqual(36.0, statistics.Var(), Tol);
            NUnit.Framework.Assert.AreEqual(6.0, statistics.Std(), Tol);
            NUnit.Framework.Assert.AreEqual(29.0, statistics.Outlier(1.0f), Tol);
        }
Beispiel #3
0
        public virtual long ThresholdRuntime(TaskId taskID)
        {
            JobId jobID = taskID.GetJobId();

            Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = context.GetJob(jobID);
            TaskType       type                 = taskID.GetTaskType();
            DataStatistics statistics           = DataStatisticsForTask(taskID);
            int            completedTasksOfType = type == TaskType.Map ? job.GetCompletedMaps() : job.GetCompletedReduces
                                                      ();
            int totalTasksOfType = type == TaskType.Map ? job.GetTotalMaps() : job.GetTotalReduces
                                       ();

            if (completedTasksOfType < MinimumCompleteNumberToSpeculate || (((float)completedTasksOfType
                                                                             ) / totalTasksOfType) < MinimumCompleteProportionToSpeculate)
            {
                return(long.MaxValue);
            }
            long result = statistics == null ? long.MaxValue : (long)statistics.Outlier(slowTaskRelativeTresholds
                                                                                        [job]);

            return(result);
        }