Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kenhys/groonga-plugin-grncache
https://github.com/kenhys/groonga-plugin-grncache
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kenhys/groonga-plugin-grncache
- Owner: kenhys
- License: lgpl-2.1
- Created: 2015-04-09T12:33:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-06T09:40:15.000Z (over 7 years ago)
- Last Synced: 2024-05-02T01:06:19.641Z (7 months ago)
- Language: C
- Size: 35.2 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Grncache
Grncache is a simple plugin to investigate Groonga's internal cache.
## How to setup
Build plugin like this.
```
% ./autogen.sh
% ./configure
% make
% sudo make install
```Confirm `grncache.so` is correctly installed under "`pkg-config --variable=pluginsdir groonga`/grncache". Typically, that path is equivalent to `/usr/lib/groonga/plugins/grncache/grncache.so`.
## How to use
### Prerequisite
Register `Grncache` plugin.
```
> plugin_register grncache/grncache
```Or
```
% curl http://localhost:10041/d/plugin_register?name=grncache/grncache
```### Command line interface
Here is the example how to show `Grncache` status.
```
> grncache status
[[0,1435596749.90995,4.48226928710938e-05],{"cache_entries":0,"max_cache_entries":100,"cache_fetched":0,"cache_hit":0,"cache_hit_rate":0.0}]
```Here is the example how to show `Grncache` all entries.
```
> grncache dump
[[0,1435596809.91652,4.22000885009766e-05],,[[3],[{"grn_id":3,"nref":0,"timeval":"2015-06-30 01:53:29.916194","value":"[[[1],[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"],[\"title\",\"ShortText\"]],[3,\"http://pgroonga.github.io/\",\"PGroonga!\"]]]"},{"grn_id":2,"nref":0,"timeval":"2015-06-30 01:53:29.915816","value":"[[[1],[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"],[\"title\",\"ShortText\"]],[2,\"http://mroonga.org/\",\"Mroonga!\"]]]"},{"grn_id":1,"nref":0,"timeval":"2015-06-30 01:53:29.915307","value":"[[[1],[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"],[\"title\",\"ShortText\"]],[1,\"http://groonga.org/\",\"Groonga!\"]]]"}]]
```Here is the example how to show `Grncache` which contains "github".
```
> grncache match github
[[0,1435596809.91657,2.43186950683594e-05],,[[3],[{"grn_id":3,"nref":0,"timeval":"2015-06-30 01:53:29.916194","value":"[[[1],[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"],[\"title\",\"ShortText\"]],[3,\"http://pgroonga.github.io/\",\"PGroonga!\"]]]"}]]
```### HTTP query
Here is the example how to show `Grncache` status.
```
% curl http://localhost:10041/d/grncache?action=status
```Here is the example how to show `Grncache` all entries.
```
% curl http://localhost:10041/d/grncache?action=dump
```## Limitations
* `Grncache` requires Groonga 3.0.8 or later because it uses `grn_cache_current_get()` API.
* No support for Windows because Grncache use Groonga internal function.## TODO
* filter dump data