Skip to content

Commit

Permalink
Update 2.rocksdb-statistics.md (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-lzy committed Oct 26, 2021
1 parent 445db4f commit cb109b1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs-2.0/6.monitor-and-metrics/2.rocksdb-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Nebula Graph 使用 RocksDB 作为底层存储,本文介绍如何收集和展

RocksDB 统计功能默认关闭,启动 RocksDB 统计功能,你需要:

1. 修改 `storaged.conf` 文件中 `--enable_rocksdb_statistics` 参数为 `true`。配置默认文件目录为 `/use/local/nebula/etc`
1. 修改 `nebula-storaged.conf` 文件中 `--enable_rocksdb_statistics` 参数为 `true`。配置默认文件目录为 `/use/local/nebula/etc`

2. 重启服务使修改生效。

Expand Down Expand Up @@ -49,12 +49,19 @@ rocksdb.bytes.read=1632

使用以下命令获取部分 JSON 格式的 RocksDB 统计信息:
```bash
curl -L "http://${storage_ip}:${port}/rocksdb_stats?stats=${stats_name}.&returnjson"
curl -L "http://${storage_ip}:${port}/rocksdb_stats?stats=${stats_name}&format=json"
```

例如使用以下语句获取 `rocksdb.bytes.read``rocksdb.block.cache.add`的统计信息并返回 JSON 的格式数据。
```bash
curl -L "http://172.28.2.1:19779/rocksdb_stats?stats=rocksdb.bytes.read,rocksdb.block.cache.add&returnjson"

[{"value":14,"name":rocksdb.block.cache.add},{"value":1632,"name":"rocksdb.bytes.read"}]
curl -L "http://172.28.2.1:19779/rocksdb_stats?stats=rocksdb.bytes.read,rocksdb.block.cache.add&format=json"

[
{
"rocksdb.block.cache.add": 1
},
{
"rocksdb.bytes.read": 160
}
]
```

0 comments on commit cb109b1

Please sign in to comment.