# Obtaining Data Mover usage metrics

This page explains how to export usage metrics from Data Mover.

Usage metrics can help administrators understand how the product is used over time. For example, they can be used to monitor how many Actors were added or removed each month, or how many Dataflow Instances (see [Dataflow Instance Context (DFIC)](/data-mover-1.20/workflow-templates/dataflow-instance-context-dfic.md)) were generated.

### Export usage metrics

Usage metrics are exported by using the `metrics.sh` command-line tool.

The tool is available in the `bin` directory of the Ceman installation.

Use the following command to export all available monthly metrics:

<pre><code><strong>./metrics.sh -o /home/dataone/exportedMetrics.csv -u adminuser -P export
</strong></code></pre>

Where:

| Parameter | Description                                                                               |
| --------- | ----------------------------------------------------------------------------------------- |
| `-o`      | Path of the output CSV file                                                               |
| `-u`      | Username used to authenticate with Data One. The user must have administrative privileges |
| `-P`      | Prompts the user to enter the password from the console                                   |
| `export`  | Exports the monthly KPI metrics                                                           |

The command creates a CSV file containing the available usage metrics.

### Exported time range

The export includes metrics for the last 36 months.

The current month is not included because the month is still in progress.

You do not need to specify a time interval. The tool always exports the available monthly metrics for the last 36 months.

### CSV file structure

The CSV file contains one row for each metric and month.

After exporting the file, you can filter the CSV to analyze the metrics that are relevant for your usage report.

The main metrics described in this page are:

| Area                          | Metric name                                     | Description                                                               |
| ----------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------- |
| Actor                         | `dataone.actor.actorcreationcount.actors_count` | Number of Actors created in a specific month.                             |
| Actor                         | `dataone.actor.actordeletioncount.actors_count` | Number of Actors deleted in a specific month.                             |
| Data Mover Dataflow Instances | `dataone.dfiid.dfiidgenerated.dfiid_count`      | Number of Data Mover Dataflow Instance IDs generated in a specific month. |

### Actor metrics

Actor metrics provide the number of Actors created and deleted in each month.

Use these metrics to understand how the number of configured Actors changes over time.

The following metrics are available:

```
dataone.actor.actorcreationcount.actors_count
dataone.actor.actordeletioncount.actors_count
```

The creation metric counts the Actors added during the month.

The deletion metric counts the Actors removed during the month.

These metrics do not provide the total number of existing Actors. They provide monthly changes.

### Dataflow Instance metrics

Dataflow Instance metrics provide the number of Data Mover Dataflow Instance IDs generated in each month.

Use this metric to understand the monthly volume of executed integration flows.

The following metric is available:

```
dataone.dfiid.dfiidgenerated.dfiid_count
```

A Dataflow Instance represents the execution context of an integration flow. The generated DFIID is used to identify and trace that flow across Data One components.

### Additional command options

The `metrics.sh` command supports additional options.

```
metrics [-hLV] [-C=<connectTimeoutSeconds>] [-e=<secureEndpoint>] \
        -o=<outputFile> [-R=<readTimeoutSeconds>] -u=<username> \
        (-p=<passwordFile> | -P) [COMMAND]
```

| Option                            | Description                                                                                                                        |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `-C`, `--connect-timeout-seconds` | Maximum time, in seconds, allowed to establish a connection. Default value: `300`.                                                 |
| `-e`, `--endpoint`                | HTTPS endpoint of the Ceman node, for example `https://ceman:9443`. If not provided, the CLI connects to the local Ceman instance. |
| `-h`, `--help`                    | Displays the help message.                                                                                                         |
| `-L`, `--enable-console-log`      | Enables log output on the console.                                                                                                 |
| `-o`, `--output-file`             | Path of the CSV file where metrics are exported.                                                                                   |
| `-p`, `--password-file`           | Path to a file containing the password in plain text. The file must contain a single line.                                         |
| `-P`, `--password`                | Prompts the user to enter the password from the console.                                                                           |
| `-R`, `--read-timeout-seconds`    | Maximum time, in seconds, to wait for a response. Default value: `300`.                                                            |
| `-u`, `--username`                | Username used to authenticate with Data One. The user must have administrative privileges.                                         |
| `-V`, `--version`                 | Prints the CLI version information and exits.                                                                                      |

### Notes

* the exported metrics are monthly summary KPIs
* the current month is not exported
* the export always covers the last 36 months
* the CSV file can contain metrics other than Actor and Dataflow Instance metrics. Filter the file if you only need usage metrics for Actors and Dataflow Instances


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-mover-1.20/usage-metrics/obtaining-data-mover-usage-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
