Esempio n. 1
0
        public string GetClearTextLogString(bool formatAsHtml)
        {
            System.Text.StringBuilder reportBody = new System.Text.StringBuilder();

            string msg = "Send Newsletter report \nSubject: {5} \nStart: {0} \nFinished: {1} \nDuration: {2}ms \nEmails sent: {3} \n Errors: {4}\n";

            reportBody.AppendFormat(msg,
                                    SendStart.ToString(),
                                    SendStop.ToString(),
                                    TotalDuration.ToString(),
                                    SuccessMessages.Count.ToString(),
                                    ErrorMessages.Count.ToString(),
                                    Subject
                                    );

            GetMessagesMarkup(formatAsHtml, reportBody, ErrorMessages, "Errors", "danger");

            GetMessagesMarkup(formatAsHtml, reportBody, WarningMessages, "Warnings", "warning");

            msg = reportBody.ToString();
            if (formatAsHtml)
            {
                msg = msg.Replace("\n", "<br />\n");
            }

            return(msg);
        }
Esempio n. 2
0
        public override string ToString()
        {
            var notation = string.Empty;

            if (FileCached)
            {
                notation += @"Total
FileData Cached";
            }

            var Values = string.Empty;

            foreach (var item in ValueDurations)
            {
                if (Values == string.Empty)
                {
                    Values += $"v:{item.Name} = {item.Value}";
                }
                else
                {
                    Values += $@"
v:{item.Name} = {item.Value}";
                }
            }

            return($@"{notation}Non Lazy Value(s) Count {Count}
{Values}
Add SourceType Duration {AddSourceTypeDuration.ToShortReadableString()}
Non Lazy Total Duration {TotalDuration.ToShortReadableString()}");
        }
        public override string ToString()
        {
            return($@"TotalMS {Math.Round(TotalTimeDuration.TotalMilliseconds)} | AvgMS {Math.Round(AverageTimeMS)}
Total {TotalTimeDuration.ToShortReadableString()}
Total FileData Duration {TotalDuration.ToShortReadableString()}

{InitializeFileDetail}

{Detail}");
        }
Esempio n. 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)BatchType;
         hashCode = (hashCode * 397) ^ (IndexesToWorkOn != null ? IndexesToWorkOn.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TotalDocumentCount;
         hashCode = (hashCode * 397) ^ TotalDocumentSize.GetHashCode();
         hashCode = (hashCode * 397) ^ StartedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalDuration.GetHashCode();
         hashCode = (hashCode * 397) ^ (PerformanceStats != null ? PerformanceStats.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 5
0
    /// <summary>
    /// Gets the time from the first action.
    /// </summary>
    /// <param name="time">Time of the action</param>
    protected string GetFromStart(object time)
    {
        DateTime t = ValidationHelper.GetDateTime(time, DateTime.MinValue);

        if (firstTime == DateTime.MinValue)
        {
            firstTime = t;
        }

        lastTime      = t;
        TotalDuration = t.Subtract(firstTime).TotalSeconds;

        return(TotalDuration.ToString("F3"));
    }
        public override string ToString()
        {
            string S = "{0}, ".Build(Name);

            S += "Values count: {0}".Build(ValuesCount);
            if (ValuesCount > 0)
            {
                S += ", Total: {0}, ".Build(TotalDuration.Format());
                S += "Avg.: {0}, ".Build(AverageDuration.Format());
                S += "Min.: {0}, ".Build(MinDuration.Format());
                S += "Max.: {0}".Build(MaxDuration.Format());
            }
            return(S);
        }
Esempio n. 7
0
 public bool Equals(IndexingBatchInfo other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(BatchType == other.BatchType && Equals(IndexesToWorkOn, other.IndexesToWorkOn) && TotalDocumentCount == other.TotalDocumentCount && TotalDocumentSize == other.TotalDocumentSize && StartedAt.Equals(other.StartedAt) && TotalDuration.Equals(other.TotalDuration) && Equals(PerformanceStats, other.PerformanceStats));
 }