예제 #1
0
        /// <summary>
        /// 处理文件
        /// </summary>
        /// <param name="fpath"></param>
        public void Analyse(Config config)
        {
            //清空cache
            Cache.Cache.OpersList.Clear();

            //读日志、预处理、解析、存数据库
            //获取所有日志文件,然后遍历解析并汇总
            //robocopy log  //ssh log
            List <string> files = FilesManager.GetFiles(config);

            if (files != null && files.Count > 0)
            {
                _filesTotalCount  = files.Count;
                _filesReadedCount = 0;
                foreach (var file in files)
                {
                    if (_filesTotalCount == 0)
                    {
                        break;
                    }
                    ReadToCache(file);
                    _filesReadedCount++;
                }
            }
        }
예제 #2
0
 /// <summary>
 /// 获取需要解析的所有文件
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 private static int GetFilesTotalCount()
 {
     return(FilesManager.GetFiles(ConfigManager.GetCurrentConfig()).Count);
 }