loris

package module
v0.0.0-...-ba39d97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

Loris

This is a simple set/get redis-a-like implemented in golang as an experiment to better understand the performance characteristics of systems like this (and to have fun in general).

The goal is to:

  • gain more experience benchmarking and profiling software under load
  • explore the tradeoffs of different ways of sharing data on a multi-threaded sysstem

Naively, one might imagine (I did :-) that redis throughput is ultimately limited by its single threaded nature. However, coming up with a load which demonstrates that looks like it might be challenging.

Usage

You can specify different storage approaches on the command line:

$ loris -store mutex:map 

Will run a single map, protected by a mutex:

$ loris -store sharded:mutex:map 

Will run a number of maps (16), each protected by a mutex.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpDel

func OpDel(s store.Store, k store.Key, v store.Val) (store.Val, error)

func OpGet

func OpGet(s store.Store, k store.Key, v store.Val) (store.Val, error)

func OpSet

func OpSet(s store.Store, k store.Key, v store.Val) (store.Val, error)

Types

type DebugReader

type DebugReader struct {
	// contains filtered or unexported fields
}

func NewDebugReader

func NewDebugReader(r io.Reader) *DebugReader

func (*DebugReader) Read

func (dr *DebugReader) Read(p []byte) (int, error)

type OpFunc

type OpFunc func(s store.Store, k store.Key, v store.Val) (store.Val, error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewWithStore

func NewWithStore(s store.Store, debug bool) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(hostport string) error

func (*Server) StartShutdown

func (s *Server) StartShutdown()

type ServerOp

type ServerOp func(*Server, io.Writer) (resp.Typ, bool)

func ParseCommand

func ParseCommand(r io.Reader) (ServerOp, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL