/// <summary> /// Returns true if ResponseMetricsListData instances are equal /// </summary> /// <param name="other">Instance of ResponseMetricsListData to be compared</param> /// <returns>Boolean</returns> public bool Equals(ResponseMetricsListData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( RequestTime == other.RequestTime || RequestTime != null && RequestTime.Equals(other.RequestTime) ) && ( Availability == other.Availability || Availability != null && Availability.Equals(other.Availability) ) && ( Invocations == other.Invocations || Invocations != null && Invocations.Equals(other.Invocations) ) && ( AverageResponse == other.AverageResponse || AverageResponse != null && AverageResponse.Equals(other.AverageResponse) ) && ( AverageTps == other.AverageTps || AverageTps != null && AverageTps.Equals(other.AverageTps) ) && ( PeakTps == other.PeakTps || PeakTps != null && PeakTps.Equals(other.PeakTps) ) && ( Errors == other.Errors || Errors != null && Errors.Equals(other.Errors) ) && ( Rejections == other.Rejections || Rejections != null && Rejections.Equals(other.Rejections) )); }
// средние значения всех физическх показателей определенного продукта public async Task <AverageResponse> GetAvarageValuesForEachParameter(int productId) { var indicatorsInfos = await GetIndicatorsInfoList(productId); var BpAvg = indicatorsInfos.Select(x => x.BloodPressure).Average(); var BolAvg = indicatorsInfos.Select(x => x.BloodOxygenLevel).Average(); var TemperatureAvg = indicatorsInfos.Select(x => x.Temperature).Average(); var PulseAvg = indicatorsInfos.Select(x => x.Pulse).Average(); var response = new AverageResponse(); response.BloodPressure = BpAvg; response.BloodOxygenLevel = BolAvg; response.Pulse = PulseAvg; response.Temperature = TemperatureAvg; return(response); }
/// <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 (RequestTime != null) { hashCode = hashCode * 59 + RequestTime.GetHashCode(); } if (Availability != null) { hashCode = hashCode * 59 + Availability.GetHashCode(); } if (Invocations != null) { hashCode = hashCode * 59 + Invocations.GetHashCode(); } if (AverageResponse != null) { hashCode = hashCode * 59 + AverageResponse.GetHashCode(); } if (AverageTps != null) { hashCode = hashCode * 59 + AverageTps.GetHashCode(); } if (PeakTps != null) { hashCode = hashCode * 59 + PeakTps.GetHashCode(); } if (Errors != null) { hashCode = hashCode * 59 + Errors.GetHashCode(); } if (Rejections != null) { hashCode = hashCode * 59 + Rejections.GetHashCode(); } return(hashCode); } }
private static async Task UnaryOperation(StatsService.StatsServiceClient client) { AverageResponse response = await client.SingleOperation(new BulkNumbers { Items = new[] { 1d, 2d, 3d, 4d } }); Console.WriteLine("[Unary] Average is: " + response.Average); }