コード例 #1
0
        public void ReindexAllTest()
        {
            var config = new ConfigManager();
            using (var currentDB = new NAppProfiler.Server.Essent.Database(config))
            {
                currentDB.InitializeDatabase();
                using (var idxUpdate = new NAppIndexUpdater(config, currentDB))
                {
                    idxUpdate.Initialize();
                    DateTime start;
                    DateTime stop;
                    TimeSpan ts;
                    start = DateTime.UtcNow;
                    var count = idxUpdate.RebuildIndex();

                    //var totalCount = 0L;
                    //var curCount = 1L;
                    //while (curCount > 0)
                    //{
                    //    curCount = idxUpdate.UpdateIndex();
                    //    totalCount += curCount;
                    //}

                    stop = DateTime.UtcNow;
                    ts = stop - start;
                    Console.WriteLine("Index Rebuild " + count.ToString("#,##0") + " in " + ts.TotalMilliseconds.ToString("#,##0") + " ms");
                }
            }
        }
コード例 #2
0
 public JobProcessor(ConfigManager config, Database currentDb, JobQueueManager manager, NAppIndexUpdater indexUpdater, NAppIndexReader indexReader)
 {
     this.currentDb = currentDb;
     this.manager = manager;
     this.indexReader = indexReader;
     this.indexUpdater = indexUpdater;
     if (!int.TryParse(config.GetSetting(SettingKeys.Manager_ProcessorQueueSize), out this.processorQueueSize))
     {
         this.processorQueueSize = 64;
     }
     InitializeLists();
 }
コード例 #3
0
ファイル: Job.cs プロジェクト: simonkang/NAppProfiler
        public Job(ConfigManager config, JobQueueManager manager, bool IsDatabaseTask, bool traceEnabled)
        {
            this.config = config;
            this.manager = manager;
            if (IsDatabaseTask)
            {
                currentDb = new Database(config);
                currentDb.InitializeDatabase();
                indexUpdater = new NAppIndexUpdater(config, currentDb);
                indexUpdater.Initialize();
            }
            indexReader = new NAppIndexReader(config);

            this.traceEnabled = traceEnabled;
        }