2024-11-01 05:15:21 +08:00
|
|
|
# Bcache Input Plugin
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
This plugin gathers statistics for the [block layer cache][bcache]
|
|
|
|
|
from the `stats_total` directory and `dirty_data` file.
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
⭐ Telegraf v0.2.0
|
|
|
|
|
🏷️ system
|
|
|
|
|
💻 linux
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
[bcache]: https://docs.kernel.org/admin-guide/bcache.html
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2022-04-08 06:01:21 +08:00
|
|
|
## Configuration
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2022-04-08 06:01:21 +08:00
|
|
|
# Read metrics of bcache from stats_total and dirty_data
|
2023-03-02 05:21:14 +08:00
|
|
|
# This plugin ONLY supports Linux
|
2020-11-23 23:40:32 +08:00
|
|
|
[[inputs.bcache]]
|
|
|
|
|
## Bcache sets path
|
|
|
|
|
## If not specified, then default is:
|
|
|
|
|
bcachePath = "/sys/fs/bcache"
|
|
|
|
|
|
|
|
|
|
## By default, Telegraf gather stats for all bcache devices
|
|
|
|
|
## Setting devices will restrict the stats to the specified
|
|
|
|
|
## bcache devices.
|
|
|
|
|
bcacheDevs = ["bcache0"]
|
2015-10-20 01:38:16 +08:00
|
|
|
```
|
|
|
|
|
|
2024-11-01 05:15:21 +08:00
|
|
|
## Metrics
|
|
|
|
|
|
|
|
|
|
Tags:
|
|
|
|
|
|
|
|
|
|
- `backing_dev` device backed by the cache
|
|
|
|
|
- `bcache_dev` device used for caching
|
|
|
|
|
|
|
|
|
|
Fields:
|
|
|
|
|
|
|
|
|
|
- `dirty_data`: Amount of dirty data for this backing device in the cache.
|
|
|
|
|
Continuously updated unlike the cache set's version, but may be slightly off
|
|
|
|
|
- `bypassed`: Amount of IO (both reads and writes) that has bypassed the cache
|
|
|
|
|
- `cache_bypass_hits`: Hits for IO that is intended to skip the cache
|
|
|
|
|
- `cache_bypass_misses`: Misses for IO that is intended to skip the cache
|
|
|
|
|
- `cache_hits`: Hits per individual IO as seen by bcache sees them; a
|
|
|
|
|
partial hit is counted as a miss.
|
|
|
|
|
- `cache_misses`: Misses per individual IO as seen by bcache sees them; a
|
|
|
|
|
partial hit is counted as a miss.
|
|
|
|
|
- `cache_hit_ratio`: Hit to miss ratio
|
|
|
|
|
- `cache_miss_collisions`: Instances where data was going to be inserted into
|
|
|
|
|
cache from a miss, but raced with a write and data was already present
|
|
|
|
|
(usually zero since the synchronization for cache misses was rewritten)
|
|
|
|
|
- `cache_readaheads`: Count of times readahead occurred.
|
|
|
|
|
|
2022-06-08 05:10:18 +08:00
|
|
|
## Example Output
|
2015-10-20 01:38:16 +08:00
|
|
|
|
2023-04-04 19:43:49 +08:00
|
|
|
```text
|
|
|
|
|
bcache,backing_dev="md10",bcache_dev="bcache0" dirty_data=11639194i,bypassed=5167704440832i,cache_bypass_hits=146270986i,cache_bypass_misses=0i,cache_hit_ratio=90i,cache_hits=511941651i,cache_miss_collisions=157678i,cache_misses=50647396i,cache_readaheads=0i
|
2015-10-20 01:38:16 +08:00
|
|
|
```
|