public RecordStresser(PagedFile pagedFile, Condition condition, int maxRecords, RecordFormat format, int threadId, TinyLockManager locks) { this._pagedFile = pagedFile; this._condition = condition; this._maxRecords = maxRecords; this._format = format; this._threadId = threadId; this._locks = locks; }
private IList <RecordStresser> Prepare(Condition condition, PagedFile pagedFile, RecordFormat format) { int maxRecords = Math.multiplyExact(_maxPages, format.RecordsPerPage); TinyLockManager locks = new TinyLockManager(); IList <RecordStresser> recordStressers = new LinkedList <RecordStresser>(); for (int threadId = 0; threadId < _numberOfThreads; threadId++) { recordStressers.Add(new RecordStresser(pagedFile, condition, maxRecords, format, threadId, locks)); } return(recordStressers); }
internal CommandPrimer(Random rng, MuninnPageCache cache, File[] files, IDictionary <File, PagedFile> fileMap, int filePageCount, int filePageSize, RecordFormat recordFormat) { this._rng = rng; this._cache = cache; this._files = files; this._fileMap = fileMap; this._filePageCount = filePageCount; this._filePageSize = filePageSize; this._recordFormat = recordFormat; _mappedFiles = new List <File>(); ((IList <File>)_mappedFiles).AddRange(fileMap.Keys); _filesTouched = new HashSet <File>(); _filesTouched.addAll(_mappedFiles); _recordsWrittenTo = new Dictionary <File, IList <int> >(); _recordsPerPage = cache.PageSize() / recordFormat.RecordSize; _maxRecordCount = filePageCount * _recordsPerPage; _recordLocks = new TinyLockManager(); foreach (File file in files) { _recordsWrittenTo[file] = new List <int>(); } }