public RocksDBMetrics create(
      final MetricsSystem metricsSystem,
      final RocksDBConfiguration rocksDbConfiguration,
      final RocksDB db,
      final Statistics stats) {
    final OperationTimer readLatency =
        metricsSystem
            .createLabelledTimer(
                rocksDbMetricCategory,
                "read_latency_seconds",
                "Latency for read from RocksDB.",
                "database")
            .labels(rocksDbConfiguration.getLabel());
    final OperationTimer removeLatency =
        metricsSystem
            .createLabelledTimer(
                rocksDbMetricCategory,
                "remove_latency_seconds",
                "Latency of remove requests from RocksDB.",
                "database")
            .labels(rocksDbConfiguration.getLabel());
    final OperationTimer writeLatency =
        metricsSystem
            .createLabelledTimer(
                rocksDbMetricCategory,
                "write_latency_seconds",
                "Latency for write to RocksDB.",
                "database")
            .labels(rocksDbConfiguration.getLabel());
    final OperationTimer commitLatency =
        metricsSystem
            .createLabelledTimer(
                rocksDbMetricCategory,
                "commit_latency_seconds",
                "Latency for commits to RocksDB.",
                "database")
            .labels(rocksDbConfiguration.getLabel());

    RocksDBStats.registerRocksDBMetrics(stats, metricsSystem, statsDbMetricCategory);

    metricsSystem.createLongGauge(
        rocksDbMetricCategory,
        "rocks_db_table_readers_memory_bytes",
        "Estimated memory used for RocksDB index and filter blocks in bytes",
        () -> {
          try {
            return db.getLongProperty("rocksdb.estimate-table-readers-mem");
          } catch (final RocksDBException e) {
            LOG.debug("Failed to get RocksDB metric", e);
            return 0L;
          }
        });

    metricsSystem.createLongGauge(
        rocksDbMetricCategory,
        "rocks_db_files_size_bytes",
        "Estimated database size in bytes",
        () -> {
          try {
            return db.getLongProperty("rocksdb.live-sst-files-size");
          } catch (final RocksDBException e) {
            LOG.debug("Failed to get RocksDB metric", e);
            return 0L;
          }
        });

    final Counter rollbackCount =
        metricsSystem
            .createLabelledCounter(
                rocksDbMetricCategory,
                "rollback_count",
                "Number of RocksDB transactions rolled back.",
                "database")
            .labels(rocksDbConfiguration.getLabel());

    return new RocksDBMetrics(
        readLatency, removeLatency, writeLatency, commitLatency, rollbackCount);
  }
Create RocksDb metrics.

@param metricsSystem the metrics system
@param rocksDbConfiguration the rocks db configuration
@param db the db
@param stats the stats
@return the rocks db metrics
plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDBMetricsFactory.java