Exemplo n.º 1
0
        private void ClearOldOptionResults()
        {
            if (_lastClearOptionResults + _clearOptionResultsInterval > Clock.Now)
            {
                return;
            }

            DateTime maxAllowedEndDate = Clock.Now - _clearOptionResultsOlderThan;

            DatabaseOptionResult.ClearOldResults(_connection, maxAllowedEndDate);

            _lastClearOptionResults = Clock.Now;
        }
Exemplo n.º 2
0
		public void EndOption(OptionBase currentOption, OptionReport report)
		{
			lock (_statusLock)
			{
				_databaseOptionStatus.ActiveOptionsRemove(currentOption.DatabaseOption);

				if (report != null)
				{
					DatabaseOptionResult.Create(_mongoConnection, report.BeginTime, report.EndTime, report.OptionType.Name, report.Success, report.Memory);

					UpdateEstimatedStatistics(report);

					if (_databaseOptionStatus.optionLastMemory.ContainsKey(report.OptionType.Name))
					{
						_databaseOptionStatus.optionLastMemory[report.OptionType.Name] = report.Memory;
					}
					else
					{
						_databaseOptionStatus.optionLastMemory.Add(report.OptionType.Name, report.Memory);
					}
				}
			}
		}