Skip to content

Commit c75e0cb

Browse files
committed
monitoring (1)
1 parent fd9ce2a commit c75e0cb

22 files changed

Lines changed: 1632 additions & 959 deletions

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
PWD=$(pwd)
2626
sudo apt-get install valgrind
27-
valgrind ./tests/${{ matrix.release }}/tests $PWD/src/server/${{ matrix.release }}/scache $PWD/testcases/
27+
valgrind --leak-check=full ./tests/${{ matrix.release }}/tests $PWD/src/server/${{ matrix.release }}/scache $PWD/testcases/
2828
- name: Spam test
2929
run: |
3030
echo "todo"

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ simple-cache
33

44
[![Build Status](https://travis-ci.org/splitice/simple-cache.svg?branch=master)](https://travis-ci.org/splitice/simple-cache)
55

6-
A simple on disk small / large key value store with LRU
6+
A simple on disk small / large key value store with LRU. Now also includes a monitoring API.
77

88
## Building
99
Compile with the provided Makefile. Requires a GCC version with C++11 support. Tested with gcc-4.8.
@@ -20,7 +20,7 @@ Compile with the provided Makefile. Requires a GCC version with C++11 support. T
2020

2121
## Requests
2222

23-
### Get Key Value
23+
### Cache: Get Key Value
2424
**GET /table/key HTTP/1.1**
2525

2626
Get the value of key in table
@@ -65,7 +65,7 @@ $ curl http://127.0.0.1:8000/table/key -XGET -v
6565
key value
6666
```
6767

68-
## Insert or Update Key
68+
## Cache: Insert or Update Key
6969
**PUT /table/key HTTP/1.1**
7070

7171
Put (Set or inset) a value (post data) into key in table
@@ -93,7 +93,7 @@ OK
9393
* Connection #0 to host 127.0.0.1 left intact
9494
```
9595

96-
## Delete Key
96+
## Cache: Delete Key
9797
**DELETE /table/key HTTP/1.1**
9898

9999
Delete the key in table
@@ -118,7 +118,7 @@ DELETED
118118
* Connection #0 to host 127.0.0.1 left intact
119119
```
120120

121-
## Delete / Purge table
121+
## Cache: Delete / Purge table
122122
**DELETE /table HTTP/1.1**
123123

124124
Delete table, effectively purging table
@@ -162,7 +162,7 @@ DELETED
162162
* Connection #0 to host 127.0.0.1 left intact
163163
```
164164

165-
## List table contents
165+
## Cache: List table contents
166166
**GET /table HTTP/1.1**
167167

168168
Get a listing of keys in the table. NOTE: This may return duplicates
@@ -207,7 +207,7 @@ key
207207
* Closing connection 0
208208
```
209209

210-
**Request headers supported:**
210+
**Cache: Request headers supported:**
211211

212212
GET (key):
213213
- None
@@ -223,6 +223,9 @@ PUT:
223223
DELETE:
224224
- None
225225

226+
**Monitoring: Get root page (Also available as HEAD):**
227+
**GET / HTTP/1.1**
228+
226229
### Block File
227230
```
228231
-----------------------------------------

src/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ error:
3434
$(error Invalid configuration, please check your inputs)
3535
endif
3636

37-
SOURCEFILES := connection.cpp db.cpp hash.cpp http.cpp http_parse.cpp http_respond.cpp read_buffer.cpp settings.cpp timer.cpp
37+
SOURCEFILES := connection.cpp db.cpp hash.cpp http.cpp http_parse.cpp http_parse_cache.cpp http_parse_mon.c http_respond.cpp read_buffer.cpp settings.cpp timer.cpp
3838
EXTERNAL_LIBS :=
3939
EXTERNAL_LIBS_COPIED := $(foreach lib, $(EXTERNAL_LIBS),$(BINARYDIR)/$(notdir $(lib)))
4040

src/core/config.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
#define MAX_PATH 512
55
#define SHORT_PATH 400
66
#define NUM_EVENTS 32
7+
#define NUM_EVENTS_ACCEPT 8
78

8-
#define CONNECTION_HASH_ENTRIES 1024
9+
#define CONNECTION_HASH_ENTRIES 4096
910

1011
#ifdef DEBUG_BUILD
1112
#define DB_LRU_EVERY 1

0 commit comments

Comments
 (0)