예제 #1
0
 public PlottingStatisticsID(PlotLog plotLog)
 {
     LogFolder  = plotLog.LogFolder;
     Tmp1Drive  = plotLog.Tmp1Drive;
     Tmp2Drive  = plotLog.Tmp2Drive;
     PlotSize   = plotLog.PlotSize;
     Threads    = plotLog.Threads;
     BufferSize = plotLog.Buffer;
     Tmp2Drive  = plotLog.Tmp2Drive;
     Buckets    = plotLog.Buckets;
 }
예제 #2
0
        /**
         * An average over some plotlogs I had on my drive.
         * This way we can display ETA and Time Remaining even
         * when the user does not have finished plotlogs (will
         * be imprecise tho).
         * That way we get better warning and error thresholds
         * from the beginning too, as they were diced before.
         * See Issue #23
         */
        private PlottingStatistics MagicNumbers()
        {
            List <PlotLog> plotLogs     = new List <PlotLog>();
            var            magicPlotLog = new PlotLog();

            magicPlotLog.Phase1Seconds   = 31573;
            magicPlotLog.Phase2Seconds   = 12298;
            magicPlotLog.Phase3Seconds   = 34925;
            magicPlotLog.Phase4Seconds   = 3024;
            magicPlotLog.CopyTimeSeconds = 934;
            plotLogs.Add(magicPlotLog);
            return(new PlottingStatistics(plotLogs));
        }
예제 #3
0
        private PlotLog NextPlotLog()
        {
            var oldPlotLog = CurrentPlotLog();

            oldPlotLog.IsLastInLogFile = false;
            var newPlotLog = new PlotLog();

            // when plot create --num n is used parameters stay the same
            newPlotLog.Buckets        = oldPlotLog.Buckets;
            newPlotLog.Threads        = oldPlotLog.Threads;
            newPlotLog.Buffer         = oldPlotLog.Buffer;
            newPlotLog.Tmp1Drive      = oldPlotLog.Tmp1Drive;
            newPlotLog.Tmp2Drive      = oldPlotLog.Tmp2Drive;
            newPlotLog.DestDrive      = oldPlotLog.DestDrive;
            newPlotLog.LogFile        = oldPlotLog.LogFile;
            newPlotLog.LogFolder      = oldPlotLog.LogFolder;
            newPlotLog.PlaceInLogFile = oldPlotLog.PlaceInLogFile + 1;
            PlotLogs.Add(newPlotLog);
            return(newPlotLog);
        }
예제 #4
0
        public PlottingStatistics GetMostRelevantStatistics(PlotLog plotLog)
        {
            PlottingStatisticsID id = new PlottingStatisticsID(plotLog);
            Dictionary <int, List <PlotLog> > byRelevance = new Dictionary <int, List <PlotLog> >();

            foreach (var fromAll in AllPlotLogs)
            {
                int relevance = id.CalcRelevance(new PlottingStatisticsID(fromAll), weights);
                // Debug.WriteLine(relevance);
                if (!byRelevance.ContainsKey(relevance))
                {
                    byRelevance.Add(relevance, new List <PlotLog>());
                }
                byRelevance[relevance].Add(fromAll);
            }

            int highestRelevance = -1;

            foreach (var relevance in byRelevance.Keys)
            {
                if (relevance > highestRelevance)
                {
                    highestRelevance = relevance;
                }
            }

            if (highestRelevance > -1)
            {
                List <PlotLog> plotLogs = byRelevance[highestRelevance];
                return(new PlottingStatistics(plotLogs.ToList()));
            }
            if (AllPlotLogs.Count > 0)
            {
                return(new PlottingStatistics(AllPlotLogs.ToList()));
            }
            else
            {
                return(MagicNumbers());
            }
        }
예제 #5
0
        public PlotLogReadable(PlotLog plotLog)
        {
            this.Tmp1Drive = plotLog.Tmp1Drive;
            this.Tmp2Drive = plotLog.Tmp2Drive;
            if (plotLog.Errors > 0)
            {
                this.Errors = plotLog.Errors.ToString();
            }
            this.Progress = string.Format("{0:0.00}", plotLog.Progress) + "%";
            if (string.Equals(this.Progress, "NaN%"))
            {
                this.Progress = "";
            }
            switch (plotLog.CurrentPhase)
            {
            case 1:
                this.CurrentPhase = "1/5";
                this.CurrentTable = plotLog.Phase1Table + "/7 ↑";
                break;

            case 2:
                this.CurrentPhase = "2/5";
                this.CurrentTable = plotLog.Phase2Table + "/7 ↓";
                break;

            case 3:
                this.CurrentPhase = "3/5";
                this.CurrentTable = plotLog.Phase3Table + "/7 ↑";
                break;

            case 4:
                this.CurrentPhase = "4/5";
                this.CurrentTable = "1/1";
                break;

            case 5:
                this.CurrentPhase = "5/5";
                this.CurrentTable = "";
                break;

            case 6:     // done
                this.CurrentPhase = "";
                this.CurrentTable = "";
                break;
            }
            this.ETA                     = formatDateTime(plotLog.ETA);
            this.StartDate               = formatDateTime(plotLog.StartDate);
            this.FinishDate              = formatDateTime(plotLog.FinishDate);
            this.TimeRemaining           = formatSeconds(plotLog.TimeRemaining);
            this.Phase1Seconds           = formatSeconds(plotLog.Phase1Seconds);
            this.Phase2Seconds           = formatSeconds(plotLog.Phase2Seconds);
            this.Phase3Seconds           = formatSeconds(plotLog.Phase3Seconds);
            this.Phase4Seconds           = formatSeconds(plotLog.Phase4Seconds);
            this.CopyTimeSeconds         = formatSeconds(plotLog.CopyTimeSeconds);
            this.TotalSeconds            = formatSeconds(plotLog.TotalSeconds);
            this.ApproximateWorkingSpace = plotLog.ApproximateWorkingSpace;
            this.DestDrive               = plotLog.DestDrive;
            this.FinalFileSize           = plotLog.FinalFileSize;
            this.Buckets                 = plotLog.Buckets.ToString();
            this.Threads                 = plotLog.Threads.ToString();
            this.Buffer                  = plotLog.Buffer + " MB";
            switch (plotLog.CurrentPhase)
            {
            case 1:
            case 3:
            case 4:
                this.CurrentBucket = plotLog.CurrentBucket + "/" + plotLog.Buckets;
                break;

            case 2:
            case 5:
            case 6:
                this.CurrentBucket = "";
                break;
            }
            this.PlotName       = plotLog.PlotName;
            this.LogFolder      = plotLog.LogFolder;
            this.LogFile        = plotLog.LogFile.Substring(plotLog.LogFile.LastIndexOf("\\") + 1);
            this.Health         = formatHealth(plotLog.Health);
            this.PlaceInLogFile = plotLog.PlaceInLogFile;
        }
예제 #6
0
        public PlotLogReadable(PlotLog plotLog)
        {
            this.Tmp1Drive = plotLog.Tmp1Drive;
            this.Tmp2Drive = plotLog.Tmp2Drive;
            if (plotLog.Errors > 0)
            {
                this.Errors = plotLog.Errors.ToString();
            }
            this.Progress = string.Format("{0:0.00}", plotLog.Progress) + "%";
            if (string.Equals(this.Progress, "NaN%"))
            {
                this.Progress = "";
            }
            switch (plotLog.CurrentPhase)
            {
            case 1:
                this.CurrentPhase = "1/5";
                this.CurrentTable = plotLog.Phase1Table + "/7 ↑";
                break;

            case 2:
                this.CurrentPhase = "2/5";
                this.CurrentTable = plotLog.Phase2Table + "/7 ↓";
                break;

            case 3:
                this.CurrentPhase = "3/5";
                this.CurrentTable = plotLog.Phase3Table + "/7 ↑";
                break;

            case 4:
                this.CurrentPhase = "4/5";
                this.CurrentTable = "1/1";
                break;

            case 5:
                this.CurrentPhase = "5/5";
                this.CurrentTable = "";
                break;

            case 6:     // done
                this.CurrentPhase = "";
                this.CurrentTable = "";
                break;
            }
            this.ETA                     = Formatter.formatDateTime(plotLog.ETA);
            this.StartDate               = Formatter.formatDateTime(plotLog.StartDate);
            this.FinishDate              = Formatter.formatDateTime(plotLog.FinishDate);
            this.TimeRemaining           = Formatter.formatSeconds(plotLog.TimeRemaining, true);
            this.Phase1Cpu               = Formatter.formatCpuUsage(plotLog.Phase1Cpu);
            this.Phase2Cpu               = Formatter.formatCpuUsage(plotLog.Phase2Cpu);
            this.Phase3Cpu               = Formatter.formatCpuUsage(plotLog.Phase3Cpu);
            this.Phase4Cpu               = Formatter.formatCpuUsage(plotLog.Phase4Cpu);
            this.Phase1Seconds           = Formatter.formatSeconds(plotLog.Phase1Seconds, true);
            this.Phase2Seconds           = Formatter.formatSeconds(plotLog.Phase2Seconds, true);
            this.Phase3Seconds           = Formatter.formatSeconds(plotLog.Phase3Seconds, true);
            this.Phase4Seconds           = Formatter.formatSeconds(plotLog.Phase4Seconds, false);
            this.CopyTimeSeconds         = Formatter.formatSeconds(plotLog.CopyTimeSeconds, false);
            this.TotalSeconds            = Formatter.formatSeconds(plotLog.TotalSeconds, true);
            this.RunTimeSeconds          = Formatter.formatSeconds(plotLog.RunTimeSeconds, true);
            this.ApproximateWorkingSpace = plotLog.ApproximateWorkingSpace;
            this.DestDrive               = plotLog.DestDrive;
            this.FinalFileSize           = plotLog.FinalFileSize;
            this.Buckets                 = plotLog.Buckets.ToString();
            this.Threads                 = plotLog.Threads.ToString();
            this.Buffer                  = plotLog.Buffer + " MB";
            this.PoolPuzzleHash          = plotLog.PoolPuzzleHash;
            this.LastLogLine             = plotLog.LastLogLine;
            if (plotLog.PID != 0)
            {
                this.PID = "" + plotLog.PID;
            }
            switch (plotLog.CurrentPhase)
            {
            case 1:
            case 3:
            case 4:
                this.CurrentBucket = plotLog.CurrentBucket + "/" + plotLog.Buckets;
                break;

            case 2:
            case 5:
            case 6:
                this.CurrentBucket = "";
                break;
            }
            this.PlotName       = plotLog.PlotName;
            this.LogFolder      = plotLog.LogFolder;
            this.LogFile        = plotLog.LogFile.Substring(plotLog.LogFile.LastIndexOf(Path.DirectorySeparatorChar) + 1);
            this.Health         = Formatter.formatHealth(plotLog.Health);
            this.PlaceInLogFile = plotLog.PlaceInLogFile + "/" + plotLog.QueueSize;
            this.Note           = plotLog.Note;
        }