Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 1.59 KB

README.md

File metadata and controls

75 lines (61 loc) · 1.59 KB

log_analyzer

A small library for analyzing log files.

Project setup

bundle exec bin/setup

Usage

To run script use:

ruby bin/parse file_path

You can decide which of analyze you want to run by passing optional argument to script like this:

ruby bin/parse file_path optional_argument
Field Type Description
file_path String Path to a file to be analysed
optional_argument String It is a analyze type, by defaut set to 'all', other options are: 'views' and 'uniq_views'

You can run example on your own following these steps:

  1. Clone repository
  2. Open repository directory
  3. Execute
ruby bin/setup
  1. Get a path to real data or to test data on your local machine and use it as a path_file in a script below:
ruby bin/parse file_path

For data:

/test_page_1/1 111.222.333.444
/test_page_1/1 999.888.777.666
/test_page_2 999.888.777.666
/test_page_2 999.888.777.666
/test_page_2 111.222.333.444

Result looks like this:

----- Statistics for visits ----
/test_page_2 - 3 visits
/test_page_1/1 - 2 visits
----- Statistics for unique visits ----
/test_page_2 - 2 unique visits
/test_page_1/1 - 2 unique visits

To run console use:

ruby bin/console

Linters

rubocop

add -a if you want autocorrection

Run specs

bundle exec rspec

To see test coverage after running specs go to coverage/index.html