GithubHelp home page GithubHelp logo

pocketlab_challenge_test's Introduction

Developer Challenge Test

The objective of this challenge is to parse a log file and do some analysis on it.

Used technology

  • PHP

How to use

You can simply use library with call LogReader class like below for the given url.

Given Url :

GET /api/users/{user_id}/count_pending_messages

GET /api/users/{user_id}/get_messages

GET /api/users/{user_id}/get_friends_progress

GET /api/users/{user_id}/get_friends_score

POST /api/users/{user_id}

GET /api/users/{user_id}

// call logreader class

$reader = new LogReader( $filePath );

// Get data for each of the required URLs (in string format)

$pendingMsgData = $reader->getUrlData('count_pending_messages', 'get', true);

$getMsgData = $reader->getUrlData('get_messages', 'get', true);

$friendProgData = $reader->getUrlData('get_friends_progress', 'get', true);

$friendScData = $reader->getUrlData('get_friends_score', 'get', true);

$usersGetData = $reader->getUrlData('users', 'get', true);

$usersPostData = $reader->getUrlData('users', 'post', true);

Running through CLI

You can run this script through CLI like below.

  • go to this test root directory

  • than run command like below

    php test.php sample.log (third arguement is to give filepath of the log)

  • so you can see output in a text format for each url.

Runing through browser

  • I have already added sample.log file into test root directory. so please check it, if its not there and please put it there before run this script on browser.
  • than you can directly run test.php and see output into browser.

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.