示例#1
0
        public BasicStatsHelper(string uniqueSymbol, BackgroundStatsQueue processQueue)
        {
            _uniqueSymbol = uniqueSymbol;
            _processQueue = processQueue;
            DateTime now = DateTime.Now;

            _nextInterval = new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0);
            _nextInterval = _nextInterval.AddHours(1);
            //_nextInterval = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0);
            //_nextInterval = _nextInterval.AddMinutes(1);
            _fullPath = System.IO.Path.Combine(_path, _folder);

            if (!System.IO.Directory.Exists(_fullPath))
            {
                System.IO.Directory.CreateDirectory(_fullPath);
            }

            _fullPathWithFileName = Path.Combine(_fullPath, DateTime.Now.ToString("yyyy-MM-dd_HHmmss") + "_" + _uniqueSymbol + ".txt");
            _streamWriter         = new StreamWriter(_fullPathWithFileName);
        }
示例#2
0
 public StatsService(BackgroundStatsQueue queue, ILogger <StatsService> logger)
 {
     _filesToProcess = queue;
     _logger         = logger;
 }