afv-library/skills/platform-data-and-tooling-api-context-get/assets/enterprise_api/PlatformEventUsageMetric.json

116 lines
8.8 KiB
JSON

{
"sections": [
"title",
"description",
"fields",
"usage",
"wsdl_segment",
"field_reference"
],
"title": "PlatformEventUsageMetric - Data API",
"description": "Contains usage data for event publishing and delivery to CometD and Pub/Sub API clients, empApi Lightning components, and event relays. If Enhanced Usage Metrics isn't enabled, usage data is available for the last 24 hours, ending at the last hour, and for historical daily usage. In API 58.0 and later, you can enable Enhanced Usage Metrics to get usage data by event name and client for granular time intervals. PlatformEventUsageMetric contains separate usage metrics for platform events and change data capture events. This object is available in API version 50.0 and later.",
"fields_columns": [
"type",
"properties",
"description"
],
"fields": {
"Client": {
"type": "string",
"properties": "Filter, Group, Nillable, Sort",
"description": "This field is available only when Enhanced Usage Metrics is enabled. The ID of the client. The Client field is populated with one of the following values. The Client field can be one of these values. For a Streaming API (CometD) client and the empApi Lightning component, the client value is the ID of the CometD session. For a Pub/Sub API client, the client value is PUB_SUB_API. For an event relay, the client value is EVENT_RELAY. For the publish usage of Change Data Capture events, the client value is SYSTEM. For publish usages using REST API, the client value is REST_API. For publish usages using Flow, the client value is FLOW. For publish usages using SOAP API, the client value is SOAP_API. For publish usages using Bulk API, the client value is BULK_API. For Apex, the publish usage client value is APEX and the delivery usage client value is the Apex Trigger ID starting with 01q."
},
"EndDate": {
"type": "dateTime",
"properties": "Filter, Nillable, Sort",
"description": "The end date and time in UTC used for querying usage metrics. The date granularity is hourly. To get usage data for the last 24 hours, the end date is the current date in UTC. The time is the current time in UTC rounded down to the previous hour. For example, 11:23 is 11:00 and the date format is: 2020-08-04T11:00:00.000Z To get historical data, the end date in UTC is the end of the date range with hours specified as 0. For example: 2020-08-04T00:00:00.000Z. To query a date range, you can use the < or <= operators. For the date format to use, see Date Formats and Date Literals in the SOQL and SOSL Reference."
},
"EventName": {
"type": "string",
"properties": "Filter, Group, Nillable, Sort",
"description": "This field is available only when Enhanced Usage Metrics is enabled. The API name of a custom platform event or a change event. Custom platform event with the label My Event: My_Event__e Change event example: AccountChangeEvent When you query usage metrics for EventName, specify the UsageType field in the SELECT or WHERE clause."
},
"EventType": {
"type": "picklist",
"properties": "Filter, Group, Nillable, Restricted picklist, Sort",
"description": "This field is available when Enhanced Usage Metrics is enabled. The type of event you would like to query usage metrics for, such as a change event or a custom platform event. Possible values are: CHANGE_EVENT—A Change Data Capture event. CUSTOM_PLATFORM_EVENT—A platform event that an admin defined in your Salesforce org. When you query usage metrics for EventType, specify the UsageType field in the SELECT or WHERE clause."
},
"ExternalId": {
"type": "string",
"properties": "Filter, Group, Nillable, Sort",
"description": "This field is not in use."
},
"Name": {
"type": "picklist",
"properties": "Filter, Group, Restricted picklist, Sort",
"description": "The name of the metric to get usage for. Possible values are: CHANGE_EVENTS_DELIVERED—Number of change data capture events delivered to CometD and Pub/Sub API clients, empApi Lightning components, and event relays CHANGE_EVENTS_PUBLISHED—Number of change data capture events published PLATFORM_EVENTS_DELIVERED—Number of platform events delivered to CometD and Pub/Sub API clients, empApi Lightning components, and event relays PLATFORM_EVENTS_PUBLISHED—Number of platform events published"
},
"StartDate": {
"type": "dateTime",
"properties": "Filter, Nillable, Sort",
"description": "The start date and time in UTC used for querying usage metrics. The date granularity is hourly. To get usage data for the last 24 hours, the start date is the previous day in UTC. The time is the current time in UTC rounded down to the previous hour. For example, 11:23 is 11:00 and the date format is: 2020-08-03T11:00:00.000Z To get historical data, the start date is the start of the date range with hours specified as 0. For example: 2020-08-03T00:00:00.000Z. To specify a date range, you can use the > or >= operators. If Enhanced Usage Metrics is enabled, keep in mind these tips. Make sure the time span between StartDate and EndDate is valid for the TimeSegment value chosen. The maximum date range that you can specify between StartDate and EndDate is 60 days. For the date format to use, see Date Formats and Date Literals in the SOQL and SOSL Reference."
},
"TimeSegment": {
"type": "picklist",
"properties": "Filter, Group, Nillable, Restricted picklist, Sort",
"description": "This field is available when Enhanced Usage Metrics is enabled. The time interval used for aggregating usage data returned in the query results. Valid TimeSegment values depend on the time range specified with StartDate and EndDate. Possible values are: Daily Usage data is aggregated for each day within the specified time range. Valid only if the time range specified with StartDate and EndDate in the query is at least 24 hours. Hourly Usage data is aggregated for each hour within the specified time range. Valid only if the time range specified with StartDate and EndDate in the query is between one hour and 24 hours. FifteenMinutes Usage data is aggregated for each 15-minute period within the specified time range. Valid only if the time range specified with StartDate and EndDate in the query is between 15 minutes and one hour."
},
"Daily": {
"description": "Usage data is aggregated for each day within the specified time range."
},
"Hourly": {
"description": "Usage data is aggregated for each hour within the specified time range."
},
"FifteenMinutes": {
"description": "Usage data is aggregated for each 15-minute period within the specified time range."
},
"UsageType": {
"type": "picklist",
"properties": "Filter, Group, Nillable, Restricted picklist, Sort",
"description": "This field is available when Enhanced Usage Metrics is enabled. The type of event usage metrics to query for, such as event publishing or event delivery. Use this field with the EventName or EventType fields. Possible values are: PUBLISH—Usage metrics for published events. DELIVERY—Usage metrics for events that were delivered to subscribers."
},
"Value": {
"type": "long",
"properties": "Filter, Group, Nillable, Sort",
"description": "The usage value for the specified metric and date range."
}
},
"usage": "For more information, see Monitor Platform Event Publishing and Delivery Usage in the Platform Events Developer Guide.",
"wsdl_segment": "```xml\n<complexType name=\"PlatformEventUsageMetric\">\n <complexContent>\n <extension base=\"ens:sObject\">\n <sequence>\n <element name=\"EndDate\" nillable=\"true\" minOccurs=\"0\" type=\"xsd:dateTime\"/>\n <element name=\"ExternalId\" nillable=\"true\" minOccurs=\"0\" type=\"xsd:string\"/>\n <element name=\"Name\" nillable=\"true\" minOccurs=\"0\" type=\"xsd:string\"/>\n <element name=\"StartDate\" nillable=\"true\" minOccurs=\"0\" type=\"xsd:dateTime\"/>\n <element name=\"Value\" nillable=\"true\" minOccurs=\"0\" type=\"xsd:long\"/>\n </sequence>\n </extension>\n </complexContent>\n</complexType>\n```",
"field_reference": {
"EndDate": {
"field_label": "End Date",
"type": "datetime"
},
"ExternalId": {
"field_label": "External ID",
"type": "string",
"length": "255"
},
"Id": {
"field_label": "Platform Event Usage Metric ID",
"type": "id",
"length": "18"
},
"Name": {
"field_label": "Metric Name",
"type": "picklist",
"length": "255"
},
"StartDate": {
"field_label": "Start Date",
"type": "datetime"
},
"Value": {
"field_label": "Metric Value",
"type": "long",
"digits": "18"
}
},
"field_reference_columns": [
"field_label",
"type",
"length",
"digits"
]
}