MemCached server and client based on the Memcached Protocol. It supports a subset of commands
Retrieval commands:
- get
- gets
Storage commands:
- set
- add
- replace
- append
- prepend
- cas
These instructions will get you a server and a client running on your local machine.
You need Ruby v2.5 or greater. Other versions may work, but are not guaranteed. Clone this repository on the desired path.
In the path lib/Server:
ruby server_cli.rb
And the server will start with the following default parameters:
- address: localhost
- port: 11211
- time_crawler: 30
For more details:
ruby server_cli.rb -h
In Ruby, require the library and instantiate a Memcached Server object:
require_relative 'server.rb'
server = Server.new("localhost",11211,30)
server.start_server
In Ruby, require the library and instantiate a Memcached Client object:
require_relative 'client.rb'
client = Client.new("localhost",11211)
client.start_client
Adding the first values into Memcached:
key = "hello"
data = "world"
client.set(key,data)
Retrive the value:
client.get("hello")
It returns an array of ClientValue objects
You can set with an expiration timeout in seconds or UNIX Time and an unique number:
exp_time = 12
flag = 99
client.set(key,data,exp_time,flag)
You can get multiple values at once:
client.set("key1","data1")
client.set("key2","data2")
client.get("key1","key2")
You need Ruby v2.5 or greater. Other versions may work, but are not guaranteed.
In the path test/Unit:
ruby memcached_spec.rb
It will run all tests. To run each test individually:
ruby client_spec.rb
ruby data_structures_spec.rb
ruby input_parser_spec.rb
You need Ruby v2.5 or greater and JMeter v5.2.1 or greater. Other versions may work, but are not guaranteed.
First, run the data generator
ruby data_generator.rb
Then:
jmeter -n -t .\test_plan.jmx
This will generate a file called results.jtl
. To convert it to HTML:
jmeter -g .\results.jtl -o ./results
In the folder results
it will appear a file called index.html
Created by @nahuelbiladoniga
This project is licensed under the MIT License - see the LICENSE file for details