Giter VIP home page Giter VIP logo

sp_test_app's Introduction

Parser

Parser is a ruby application for parsing log files and counting the statistic of users' page visits. Calculated statistic is provided directly to console and contains the following:

  • list of webpages with most page views ordered from most pages views to less page views
  • list of webpages with most unique page views also ordered

Installation

NOTE: Ruby 3.0 or higher is required

Parser's installation is pretty standard:

  • clone the repository:

    $ git clone https://github.com/YKamai/sp_test_app.git
    
  • install required ruby gems:

    $ bundle install
    

Run Parser

To run Parser app you only need to provide the path to the log file and then watch the magic happen.

$ bin/app path/to/file.log

The output result ordered descendingly by the number of visits/views will be show in you console as soon as the process is done, e.g.:

Ordered list of webpages with most page views:
/about 81 visits
/home 78 visits
...
Ordered list of webpages with most unique page views:
/home 21 unique views
/contact 10 unique views
...

Log Files

Parser expects standart logging files with extension .log. Each visit/view record has to be placed on a new line in the file and contain at least the page identifier (name, path or url) and the visitor identifier (e.g. IP address) separated by space.

An example of the log file content:

/home 682.704.613.213
/help_page/1 836.973.694.403
...

Tests

Unit tests are written with RSpec and can be run as usual:

$ rspec

Test coverage report is generated after each tests run:

$ open coverage/index.html

Code Quality

Application code is analysed by the following tools:

sp_test_app's People

Watchers

Yauhen Kamai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.