Skip to content

skilloff1337/parser-logov-oldvmp

Repository files navigation

Parser logov


RU: Программа преднозначена для сбора информации с текстовых файлов и последующим добавление нужных данных в базу данных (MongoDB). Первая версия программы, обрабатывала информацию более 5-ти часов, сейчас занимает 1:30 Минуты. Программа обрабатывает более 50.000.000 строк.
EN: The program is designed to collect information from text files and then add the necessary data to the database (MongoDB). The first version of the program processed information for more than 5 hours, now it takes 1:30 Minutes. The program processes more than 50.000.000 lines.

Technologies used | Использованные технологии

  • MongoDB.
  • Regex.

Principle of operation | Принцип работы


RU:
Изначально, мы загружаем в кэш(List) все никнеймы игроков, которые менялись. (Вызов функции SearchLastNickName.LoadChangedNicknames() Данные берем с файла LogName.txt входные данные [4/3/2017 6:19:30 PM] Diego_Johnson change name: Jeiron_Merton to Aaron_Salvatruche. С помощью Regex'a мы достаём два никнейма(Прошлый ник(Jeiron_Merton) и новый(Aaron_Salvatruche))
EN:
Initially, we load into the cache all the nicknames of the players that have changed.(Calling a function from the Program class, SearchLastNickName.LoadChangedNicknames() We take data from the file LogName.txt input data [4/3/2017 6:19:30 PM] Diego_Johnson change name: Jeiron_Merton to Aaron_Salvatruche. Using Regex, we get two nicknames (Previous nickname (Jeiron_Merton) and new one (Aaron_Salvatruche))

image


RU:
Следующий шаг, мы загружаем в кэш(Dictionary) все никнеймы игроков. (Вызов функции LoadingNickNamesToList()) Данные берем с файла LogReg.txt входные данные [4/21/2017 1:08:02 PM] Danilevich_Panuskin [###.###.##.##] [HW: SystemSerialNumber // WD-WCC3F2ZJJP3F // ]. С помощью Regex'a мы достаём два параметра(Никнейм и HardWare). И сразу вызываем функцию SearchLastNickName.SearchLastChangedNick(nickName) что бы узнать, менял ли игрок никнейм и если менял, то получить новый никнейм. Также и обрабывает HardWare - вызывая функцию GetHardWareFromString.GetHardWareList(line), что бы отсортировать плохие HardWare.


EN:
The next step, we load into the cache (Dictionary) all the nicknames of the players. (Calling the function LoadingNickNamesToList()) We take data from the file LogReg.txt input data [4/21/2017 1:08:02 PM] Danilevich_Panuskin [###.###.##.##] [HW: SystemSerialNumber // WD-WCC3F2ZJJP3F // ]. Using Regex, we get two parameters (Nickname and HardWare). And immediately call the function SearchLastNickName.SearchLastChangedNick(nickName) to find out whether the player changed his nickname and if he did, then get a new nickname. It also handles HardWare - by calling the function GetHardWareFromString.GetHardWareList(line);, to sort out the bad HardWare.

image image


RU:
После того, как у нас есть список игроков с их последними никнеймами, нам осталось лишь добавить данные, сколько они имели денег на последний момент. Для этого вызываем функцию AddMoneyToAccount(). Из-за того, что данных с деньгами слишком много, они разделены на три файла (Суммарно более 50млн строк. А вес файлов 1.89гб, 4.0гб, 0.521гб. Здесь мы читаем каждую строчку из файла и с помощью Regex'a мы получаем три параметра (Деньги на руках, деньги в банке, никнейм). Возвращаем данные во функцию, и здесь система обрабатывает, если никнейм есть в кэше(Dictionary) и эта операция новее чем была до этого, то записываются новые данные (Количество денег и номер строки с логов).


EN:
After we have a list of players with their last nicknames, we only need to add data on how much money they had at the last moment. To do this, we call the AddMoneyToAccount() function. Due to the fact that there is too much data with money, they are divided into three files (In total, more than 50 million lines. And the weight of the files is 1.89GB, 4.0GB, 0.521GB. Here we read each line from the file and using Regex we get three parameters (Money on hand, money in the bank, nickname). We return the data to the function, and here the system processes if the nickname is in the cache (Dictionary) and this operation is newer than it was before, then new data is written (Amount of money and line number from the logs).

image image


RU:
Ну и последний шаг, после того как все наши данные подготовленны, осталось добавить их только в базу данных(MongoDB). Вызываем функцию AddAccountsToMongoDateBase().Функция добавляет в базу данных по 1.000 аккаунтов. (С целью оптимизации, это лучшее значение)


EN:
Well, the last step, after all our data is prepared, it remains to add them only to the database (MongoDB). We call the function AddAccountsToMongoDateBase() The function adds 1,000 accounts to the database. (For optimization purposes, this is the best value)

image image image

Вес файлов:
image image image

Releases

No releases published

Packages

No packages published

Languages