metriclistingrep.md•29 kB
# MetricListingRep
## Example Usage
```typescript
import { MetricListingRep } from "@launchdarkly/mcp-server/models/components";
let value: MetricListingRep = {
experimentCount: 0,
metricGroupCount: 0,
id: "5902deadbeef667524a01290",
versionId: "version-id-123abc",
key: "metric-key-123abc",
name: "My metric",
kind: "custom",
attachedFlagCount: 0,
links: {
"parent": {
href: "/api/v2/metrics/my-project",
type: "application/json",
},
"self": {
href: "/api/v2/metrics/my-project/my-metric",
type: "application/json",
},
},
access: {
denied: [],
allowed: [],
},
tags: [],
creationDate: 68842,
lastModified: {
date: new Date("2021-08-05T19:46:31.148082Z"),
},
maintainerId: "569fdeadbeef1644facecafe",
maintainer: {
links: {
"self": {
href: "/api/v2/members/569f183514f4432160000007",
type: "application/json",
},
},
id: "569f183514f4432160000007",
firstName: "Ariel",
lastName: "Flores",
role: "admin",
email: "ariel@acme.com",
},
category: "Error monitoring",
isNumeric: true,
eventKey: "Order placed",
randomizationUnits: [
"user",
],
filters: {
type: "contextAttribute",
attribute: "country",
op: "<value>",
values: [
"JP",
],
contextKind: "user",
negate: false,
},
unitAggregationType: "average",
analysisType: "mean",
percentileValue: 95,
eventDefault: {
value: 0,
},
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `experimentCount` | *number* | :heavy_minus_sign: | The number of experiments using this metric | 0 |
| `metricGroupCount` | *number* | :heavy_minus_sign: | The number of metric groups using this metric | 0 |
| `id` | *string* | :heavy_check_mark: | The ID of this metric | 5902deadbeef667524a01290 |
| `versionId` | *string* | :heavy_check_mark: | The version ID of the metric | version-id-123abc |
| `key` | *string* | :heavy_check_mark: | A unique key to reference the metric | metric-key-123abc |
| `name` | *string* | :heavy_check_mark: | A human-friendly name for the metric | My metric |
| `kind` | [components.MetricListingRepKind](../../models/components/metriclistingrepkind.md) | :heavy_check_mark: | The kind of event the metric tracks | custom |
| `attachedFlagCount` | *number* | :heavy_minus_sign: | The number of feature flags currently attached to this metric | 0 |
| `links` | Record<string, [components.Link](../../models/components/link.md)> | :heavy_check_mark: | The location and content type of related resources | {<br/>"parent": {<br/>"href": "/api/v2/metrics/my-project",<br/>"type": "application/json"<br/>},<br/>"self": {<br/>"href": "/api/v2/metrics/my-project/my-metric",<br/>"type": "application/json"<br/>}<br/>} |
| `site` | [components.Link](../../models/components/link.md) | :heavy_minus_sign: | N/A | |
| `access` | [components.Access](../../models/components/access.md) | :heavy_minus_sign: | N/A | |
| `tags` | *string*[] | :heavy_check_mark: | Tags for the metric | [] |
| `creationDate` | *number* | :heavy_check_mark: | N/A | |
| `lastModified` | [components.Modification](../../models/components/modification.md) | :heavy_minus_sign: | N/A | |
| `maintainerId` | *string* | :heavy_minus_sign: | The ID of the member who maintains this metric | 569fdeadbeef1644facecafe |
| `maintainer` | [components.MemberSummary](../../models/components/membersummary.md) | :heavy_minus_sign: | N/A | |
| `description` | *string* | :heavy_minus_sign: | Description of the metric | |
| `category` | *string* | :heavy_minus_sign: | The category of the metric | Error monitoring |
| `isNumeric` | *boolean* | :heavy_minus_sign: | For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>). | true |
| `successCriteria` | [components.MetricListingRepSuccessCriteria](../../models/components/metriclistingrepsuccesscriteria.md) | :heavy_minus_sign: | For custom metrics, the success criteria | |
| `unit` | *string* | :heavy_minus_sign: | For numeric custom metrics, the unit of measure | |
| `eventKey` | *string* | :heavy_minus_sign: | For custom metrics, the event key to use in your code | Order placed |
| `randomizationUnits` | *string*[] | :heavy_minus_sign: | An array of randomization units allowed for this metric | [<br/>"user"<br/>] |
| `filters` | [components.Filter](../../models/components/filter.md) | :heavy_minus_sign: | N/A | |
| `unitAggregationType` | [components.MetricListingRepUnitAggregationType](../../models/components/metriclistingrepunitaggregationtype.md) | :heavy_minus_sign: | The method by which multiple unit event values are aggregated | average |
| `analysisType` | [components.MetricListingRepAnalysisType](../../models/components/metriclistingrepanalysistype.md) | :heavy_minus_sign: | The method for analyzing metric events | mean |
| `percentileValue` | *number* | :heavy_minus_sign: | The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when <code>analysisType</code> is <code>percentile</code>. | 95 |
| `eventDefault` | [components.MetricEventDefaultRep](../../models/components/metriceventdefaultrep.md) | :heavy_minus_sign: | N/A | |