/// <summary> /// This method sets the updated Microservice statistics. /// </summary> protected override void StatisticsRecalculate(MicroserviceStatistics stats) { stats.Id = Id; stats.Name = Id.Name; stats.Created = Id.StartTime; stats.Status = Status.ToString(); stats.LogTime = DateTime.UtcNow; stats.Tasks = mTaskManager?.Statistics; stats.DataCollection = mDataCollection?.Statistics; stats.Communication = mCommunication?.Statistics; stats.Resources = mResourceMonitor?.Statistics; stats.Commands = mCommands?.Statistics; stats.Scheduler = mScheduler?.Statistics; stats.Security = mSecurity?.Statistics; stats.Serialization = mSerializer?.Statistics; }
/// <summary> /// This method is called on a regular interval when the statistics are updated. /// </summary> /// <param name="statistics">The statistics collection.</param> internal virtual void OnStatisticsIssued(MicroserviceStatistics statistics) { try { StatisticsIssued?.Invoke(mService, new StatisticsEventArgs() { Statistics = statistics }); } catch (Exception ex) { mDataCollection?.LogException("StatisticsIssued event / external exception thrown on event", ex); } }