You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by scriptnull <vi...@gmail.com> on 2020/05/11 07:05:37 UTC

How to list caches and the number of key-values inside them

I would like to know if there is a command line tool that will help us list
down the caches and the respective number of keys present in each cache.

The closest I have got is using `control.sh` to list down the names of the
caches.

Also since we are currently only using the redis layer to create the dbs, I
wrote this little shell script to do it.

```
dbsize() {
/usr/share/apache-ignite/bin/control.sh --cache list redis-* | grep -o
"redis-ignite-internal-cache-\w*" | sed -r
's/redis-ignite-internal-cache-//g' | xargs -n 1 --replace="{}" sh -c
'printf "Database Number = {} | DBSIZE = "; redis-cli -p 11211 -n {} dbsize'
}
```

But I really wonder, if there is a clean of doing this!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to list caches and the number of key-values inside them

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

Ignite binaries contain visor cmd tool, it can do what you want:
https://apacheignite-tools.readme.io/docs/command-line-interface

Evgenii

пн, 11 мая 2020 г. в 00:05, scriptnull <vi...@gmail.com>:

> I would like to know if there is a command line tool that will help us list
> down the caches and the respective number of keys present in each cache.
>
> The closest I have got is using `control.sh` to list down the names of the
> caches.
>
> Also since we are currently only using the redis layer to create the dbs, I
> wrote this little shell script to do it.
>
> ```
> dbsize() {
> /usr/share/apache-ignite/bin/control.sh --cache list redis-* | grep -o
> "redis-ignite-internal-cache-\w*" | sed -r
> 's/redis-ignite-internal-cache-//g' | xargs -n 1 --replace="{}" sh -c
> 'printf "Database Number = {} | DBSIZE = "; redis-cli -p 11211 -n {}
> dbsize'
> }
> ```
>
> But I really wonder, if there is a clean of doing this!
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>