// Module included in the following assemblies:
//
// * storage/persistent_storage/persistent-storage-csi-aws-efs.adoc
// 
:_mod-docs-content-type: PROCEDURE
[id="efs-metrics-procedure-cli_{context}"]
= Enabling or disabling usage metrics using the CLI

[role="_abstract"]
To monitor Elastic File System (EFS) volume space consumption through the command-line interface, enable usage metrics by configuring the `ClusterCSIDriver` resource with recursive walk parameters.

You can also disable usage metrics as needed.

.Prerequisites
* Access to
ifdef::openshift-rosa,openshift-rosa-hcp[]
 a {product-title} cluster
endif::openshift-rosa,openshift-rosa-hcp[]
ifndef::openshift-rosa,openshift-rosa-hcp[]
 an {product-title} cluster
endif::openshift-rosa,openshift-rosa-hcp[]
with administrator rights
* Access to {product-title} CLI (`oc`)

.Procedure
. Edit `ClusterCSIDriver` by running the following command:
+
[source, terminal]
----
$ oc edit clustercsidriver efs.csi.aws.com
----

. Under `spec.aws.efsVolumeMetrics.state`:
+
* *Enable* metrics: Set the value to `RecursiveWalk`. `RecursiveWalk` indicates that volume metrics collection in the AWS EFS CSI Driver is performed by recursively walking through the files in the volume.

* *Disable* metrics: set the value to `Disabled`.
+
.Example ClusterCSIDriver efs.csi.aws.com YAML file
[source, yaml]
----
spec:
    driverConfig:
        driverType: AWS
        aws:
            efsVolumeMetrics:
              state: RecursiveWalk
              recursiveWalk:
                refreshPeriodMinutes: 100
                fsRateLimit: 10
----

. Optional: To define how the recursive walk operates, you can also set the following fields:
+
** `refreshPeriodMinutes`: Specifies the refresh frequency for volume metrics in minutes. If this field is left blank, a reasonable default is chosen, which is subject to change over time. The current default is 240 minutes. The valid range is 1 to 43,200 minutes.
** `fsRateLimit`: Defines the rate limit for processing volume metrics in goroutines per file system. If this field is left blank, a reasonable default is chosen, which is subject to change over time. The current default is 5 goroutines. The valid range is 1 to 100 goroutines.

. Save the changes to the `efs.csi.aws.com` object.