To configure Directory Server to log to a JSON-formatted log file with various metrics, including LDAP operation counts and GC activity, run the following command. The metrics will be written to logs/dsstats.json in the server root.
dsconfig set-plugin-prop \
    --plugin-name "Stats Logger" \
    --set enabled:true \
    --set log-file:logs/dsstats.json \
    --set log-file-format:json \
    --set local-db-backend-info:extended \
    --set header-prefix-per-column:true \
    --set empty-instead-of-zero:false \
    --set per-application-ldap-stats:per-application-and-aggregate