private string GetMailContent() { StreamReader sr = new StreamReader(@"ScriptsAndReferences\DailyStatusReport.htm"); string mailBody = sr.ReadToEnd(); sr.Close(); mailBody = mailBody.Replace("{availability}", Availability.ToString("f2") + "%"); mailBody = mailBody.Replace("{downloads}", Downloads.ToString("#,##0")); mailBody = mailBody.Replace("{restore}", Restore.ToString("#,##0")); if (Downloads == 0 || Restore == 0) { mailBody = mailBody.Replace("{warning}", "Please note that this report will not show the correct numbers for download and restore when ReplicatePackageStats Job is disabled or failing."); } else { mailBody = mailBody.Replace("{warning}", ""); } mailBody = mailBody.Replace("{searchqueries}", SearchQueries.ToString("#,##0")); mailBody = mailBody.Replace("{uploads}", Uploads.ToString()); mailBody = mailBody.Replace("{uniqueuploads}", UniqueUploads.ToString()); mailBody = mailBody.Replace("{newusers}", NewUsers.ToString()); mailBody = mailBody.Replace("{TrafficPerHour}", TrafficPerHour.ToString("#,##0")); mailBody = mailBody.Replace("{trafficmax}", TrafficMax.ToString("#,##0")); mailBody = mailBody.Replace("{trafficmin}", TrafficMin.ToString("#,##0")); mailBody = mailBody.Replace("{RequestPerHour}", RequestPerHour.ToString()); mailBody = mailBody.Replace("{requestmax}", RequestMax.ToString()); mailBody = mailBody.Replace("{requestmin}", RequestMin.ToString()); mailBody = mailBody.Replace("{ErrorsPerHour}", ErrorsPerHour.ToString()); mailBody = mailBody.Replace("{errormax}", ErrorsMax.ToString()); mailBody = mailBody.Replace("{errormin}", ErrorsMin.ToString()); mailBody = mailBody.Replace("{IndexLag}", IndexLag.ToString()); mailBody = mailBody.Replace("{indexmax}", IndexMax.ToString()); mailBody = mailBody.Replace("{indexmin}", IndexMin.ToString()); mailBody = mailBody.Replace("{InstanceCount}", InstanceCount.ToString()); mailBody = mailBody.Replace("{instancemax}", InstanceMax.ToString()); mailBody = mailBody.Replace("{instancemin}", InstanceMin.ToString()); mailBody = mailBody.Replace("{overallworkercount}", OverallWorkerCount.ToString()); mailBody = mailBody.Replace("{successcount}", SuccessCount.ToString()); mailBody = mailBody.Replace("{failedjobnames}", string.Join(", ", FailedJobNames)); mailBody = mailBody.Replace("{notableissues}", string.Join("<br/>", NotableIssues)); mailBody = mailBody.Replace("{InstallUpdatesRestoresPerNuGetVersion}", InstallUpdatesRestoresByNuGetVersion()); mailBody = mailBody.Replace("{InstallUpdatesRestoresPerVSVersion}", InstallUpdatesRestoresByVSVersion()); mailBody = mailBody.Replace("{IISRequestsDistribution}", CreateTableForIISRequestsDistribution()); mailBody = mailBody.Replace("{IPRequestDistribution}", IPDetails()); mailBody = mailBody.Replace("{ResponseTime}", ResponseTimeDetails()); mailBody = mailBody.Replace("{UserAgent}", UserAgentDetails()); return(mailBody); }
/// <summary> /// Returns true if OrgApacheSlingEngineParametersProperties instances are equal /// </summary> /// <param name="other">Instance of OrgApacheSlingEngineParametersProperties to be compared</param> /// <returns>Boolean</returns> public bool Equals(OrgApacheSlingEngineParametersProperties other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( SlingDefaultParameterEncoding == other.SlingDefaultParameterEncoding || SlingDefaultParameterEncoding != null && SlingDefaultParameterEncoding.Equals(other.SlingDefaultParameterEncoding) ) && ( SlingDefaultMaxParameters == other.SlingDefaultMaxParameters || SlingDefaultMaxParameters != null && SlingDefaultMaxParameters.Equals(other.SlingDefaultMaxParameters) ) && ( FileLocation == other.FileLocation || FileLocation != null && FileLocation.Equals(other.FileLocation) ) && ( FileThreshold == other.FileThreshold || FileThreshold != null && FileThreshold.Equals(other.FileThreshold) ) && ( FileMax == other.FileMax || FileMax != null && FileMax.Equals(other.FileMax) ) && ( RequestMax == other.RequestMax || RequestMax != null && RequestMax.Equals(other.RequestMax) ) && ( SlingDefaultParameterCheckForAdditionalContainerParameters == other.SlingDefaultParameterCheckForAdditionalContainerParameters || SlingDefaultParameterCheckForAdditionalContainerParameters != null && SlingDefaultParameterCheckForAdditionalContainerParameters.Equals(other.SlingDefaultParameterCheckForAdditionalContainerParameters) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (SlingDefaultParameterEncoding != null) { hashCode = hashCode * 59 + SlingDefaultParameterEncoding.GetHashCode(); } if (SlingDefaultMaxParameters != null) { hashCode = hashCode * 59 + SlingDefaultMaxParameters.GetHashCode(); } if (FileLocation != null) { hashCode = hashCode * 59 + FileLocation.GetHashCode(); } if (FileThreshold != null) { hashCode = hashCode * 59 + FileThreshold.GetHashCode(); } if (FileMax != null) { hashCode = hashCode * 59 + FileMax.GetHashCode(); } if (RequestMax != null) { hashCode = hashCode * 59 + RequestMax.GetHashCode(); } if (SlingDefaultParameterCheckForAdditionalContainerParameters != null) { hashCode = hashCode * 59 + SlingDefaultParameterCheckForAdditionalContainerParameters.GetHashCode(); } return(hashCode); } }
private string GetMailContent() { StreamReader sr = new StreamReader(@"ScriptsAndReferences\WeeklyStatusReport.htm"); string mailBody = sr.ReadToEnd(); sr.Close(); mailBody = mailBody.Replace("{availability}", Availability.ToString("f2") + "%"); mailBody = mailBody.Replace("{downloads}", Downloads.ToString("#,##0")); mailBody = mailBody.Replace("{restore}", Restore.ToString("#,##0")); mailBody = mailBody.Replace("{searchqueries}", SearchQueries.ToString("#,##0")); mailBody = mailBody.Replace("{uniqueuploads}", UniqueUploads.ToString()); mailBody = mailBody.Replace("{uploads}", Uploads.ToString()); mailBody = mailBody.Replace("{newusers}", NewUsers.ToString()); mailBody = mailBody.Replace("{TrafficPerHour}", TrafficPerHour.ToString("#,##0")); mailBody = mailBody.Replace("{trafficmax}", TrafficMax.ToString("#,##0")); mailBody = mailBody.Replace("{trafficmin}", TrafficMin.ToString("#,##0")); mailBody = mailBody.Replace("{RequestPerHour}", RequestPerHour.ToString()); mailBody = mailBody.Replace("{requestmax}", RequestMax.ToString()); mailBody = mailBody.Replace("{requestmin}", RequestMin.ToString()); mailBody = mailBody.Replace("{ErrorsPerHour}", ErrorsPerHour.ToString()); mailBody = mailBody.Replace("{errormax}", ErrorsMax.ToString()); mailBody = mailBody.Replace("{errormin}", ErrorsMin.ToString()); mailBody = mailBody.Replace("{IndexLag}", IndexLag.ToString()); mailBody = mailBody.Replace("{indexmax}", IndexMax.ToString()); mailBody = mailBody.Replace("{indexmin}", IndexMin.ToString()); mailBody = mailBody.Replace("{InstanceCount}", InstanceCount.ToString()); mailBody = mailBody.Replace("{instancemax}", InstanceMax.ToString()); mailBody = mailBody.Replace("{instancemin}", InstanceMin.ToString()); mailBody = mailBody.Replace("{InstallUpdatesRestoresPerNuGetVersion}", InstallUpdatesRestoresByNuGetVersion()); mailBody = mailBody.Replace("{InstallUpdatesRestoresPerVSVersion}", InstallUpdatesRestoresByVSVersion()); mailBody = mailBody.Replace("{IISRequestsDistribution}", CreateTableForIISRequestsDistribution()); mailBody = ReplaceWorkJobDetails(mailBody, DatesInWeek); return(mailBody); }