https://github.com/neomutt/test-store
Test tools for key/value stores
https://github.com/neomutt/test-store
Last synced: 11 months ago
JSON representation
Test tools for key/value stores
- Host: GitHub
- URL: https://github.com/neomutt/test-store
- Owner: neomutt
- Created: 2023-11-20T00:56:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T13:13:37.000Z (over 2 years ago)
- Last Synced: 2025-03-12T16:15:08.844Z (over 1 year ago)
- Language: C
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test Tools for Key/Value Stores
NeoMutt uses a key/value store, e.g. lmdb, as a cache for email headers.
This repo contains some test tools to work with these stores.
## lmdb-dump.c
Dump the contents of an LMDB store.
**build**:
```sh
gcc lmdb-dump.c -o lmdb-dump -llmdb
```
**run**:
```sh
./lmdb-dump store-file
```
**output**:
```
Opening store-file
key: /home/flatcap/mail/1679930513.M731552P185191.flatcap.org,S=5071,W=5169
data length: 999
key: /home/flatcap/mail/1679932108.M761797P185751.flatcap.org,S=5055,W=5153
data length: 1008
...
54569 records
```
## lmdb-cull.c
Cull a percentage of the contents of an LMDB store.
**build**:
```sh
gcc lmdb-cull.c -o lmdb-cull -llmdb
```
**run**:
```sh
# Delete a random 30% of the records
./lmdb-cull store-file 30
```
**output**:
```
Opening store-file
Culling 30%
54569 records
16321 culled
```