# Metric

- [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Metric#SCHEMA_REPRESENTATION)
- [Measure](https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Metric#Measure)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Metric#Measure.SCHEMA_REPRESENTATION)

Stores precomputed aggregated analytic data for an entity.

| JSON representation |
|---|
| ``` { "firstSeen": string, "lastSeen": string, "sumMeasure": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Metric#Measure`) }, "totalEvents": string, "metricName": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/MetricName`), "dimensions": [ enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Dimension`) ], "exportWindow": string } ``` |

| Fields ||
|---|---|
| `firstSeen` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Timestamp of the first time the entity was seen in the environment. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `lastSeen` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Time stamp of the last time last time the entity was seen in the environment. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `sumMeasure` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Metric#Measure`)`` Sum of all precomputed measures for the given metric. |
| `totalEvents` | `string (https://developers.google.com/discovery/v1/type-format format)` Total number of events used to calculate the given precomputed metric. |
| `metricName` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/MetricName`)`` Name of the analytic. |
| `dimensions[]` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Dimension`)`` All group by clauses used to calculate the metric. |
| `exportWindow` | `string (https://developers.google.com/discovery/v1/type-format format)` Export window for which the metric was exported. |

## Measure

Describes the precomputed measure.

| JSON representation |
|---|
| ``` { "value": number, "aggregateFunction": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/AggregateFunction`) } ``` |

| Fields ||
|---|---|
| `value` | `number` Value of the aggregated measure. |
| `aggregateFunction` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/AggregateFunction`)`` Function used to calculate the aggregated measure. |