Giter Site home page Giter Site logo

datadog's Introduction

DataDog

  • How to use the service
    • Run HttpTraffic.java class

Assumptions Made

  • Logs files are sorted and any new log coming in is in the future with respect to time.

Proposed design and solution implemented so far

  • Reader reads the input from the source line by line into the inmemory buffer and inserts into ArrayDeque.
  • Size of the arrayDeque is always maintained to have logs only in the time range of last 2 mins. This way we do not have to store all the logs in the queue which might not be meemory efficient or not even fit in the memory.
  • Processor gets the first element from the queue and checks with lastest log timestamp inorder to remove elements from the queue which are older than 2 minutes.
  • Processor also checks if the total number of website hits is beyond a maximum threshold and also checks if the number of website hits has fallen below a minimum threshold and alerts the system accordingly.

Improvements to be made/TODO's

  • As there could be millions of hits on the websites, going with the arrayDeque datastructure might not be memory efficient.
  • probabilistic data structures like count-min sketch can be used.

Technology Stack

  • Java 1.8

Non functional requirements

  • Scalability
    • Currently this service is running on a single server, and can take upto 200 concurrent requests. However, in order to handle billion’s of requests, we need to increase servers.
    Lets say each request takes 2sec which is the latency
    (No of concurrent connections per server * No of servers) = Total no of requests per sec * Latency
    No of servers = (Total no of requests per sec * Latency)/No of concurrent connections per server	
    
  • Load testing
    • Service should continue to have the same latency even if the load on the application increases indefinitely.
    • Used a postman collection runner to run multiple requests at the same time without any delay.

datadog's People

Contributors

raginisharma14 avatar

Watchers

James Cloos avatar  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.