Giter VIP home page Giter VIP logo

network-cache's Introduction

HW4: Let's network

Authors: Hien Nguyen, David Tamas-Parris

How to Build

Installation

First, make sure you have all the dependencies needed to run this project. We use Boost v1.69.0 [download here], Crow (a single header file crow_all.h has been included in this repository, which can also be downloaded here), and nlohmann/json for reading JSON data (follow the download instructions here).

To install Boost v1.69.0, run the following commands

wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
tar -zxvf boost_1_69_0.tar.gz
cd boost_1_69_0
./bootstrap.sh    # this will generate ./b2
sudo ./b2 install

You can check the installed version by running

cat /usr/local/include/boost/version.hpp | grep "BOOST_LIB_VERSION"

If you see something like below, you have the correct version installed.

#define BOOST_LIB_VERSION "1_69"

Compiling and running

To compile all programs, run

make

Then start the server (default running on port 8080),

./cache_server

cache_server accepts four optional command line arguments. -m maxmem, -s server, -p port, and -t threads. You can assume the server is always running on 127.0.0.1, and ignore the thread count option for now. However, for the purpose of testing the cache, you can try setting maxmem to some number (default is 8), and changing the default port.

To check the status of all networking tests, in another terminal tab, run

./test_cache_client --success

Test Report

We tested the cache behavior over the network. The cache_server handles all cache operations as prompted by cache_client via TCP connection and HTTP requests, and then communicate back the results to cache_client.

Test name Description Status
Get Nothing Assuring that get should not retrieve a key that wasn't inserted. PASSED
Set/Get get should retrieve an inserted key and modify size appropriately. PASSED
Tracking Memory Assuring that space_used() responds appropriately to new insertions. PASSED
Modification get should retrieve a key that was inserted and modified. PASSED
Proper Insertion Cache should stop accepting more keys when maxmem is exceeded PASSED
Proper Deletion get should not retrieve a key that was inserted and deleted. PASSED

Lastly, we ran valgrind to ensure no memory leaks on both the client and server side.

network-cache's People

Contributors

yonebayashi avatar davidatp avatar

Watchers

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