Reliable Service Remoting 的诊断和性能监视Diagnostics and performance monitoring for Reliable Service Remoting

Reliable ServiceRemoting 运行时会发出性能计数器The Reliable ServiceRemoting runtime emits performance counters. 这些有助于深入了解 ServiceRemoting 的运行状况以及进行故障排除和性能监视。These provide insights into how the ServiceRemoting is operating and help with troubleshooting and performance monitoring.

性能计数器Performance counters

Reliable ServiceRemoting 运行时定义以下性能计数器类别:The Reliable ServiceRemoting runtime defines the following performance counter categories:

CategoryCategory 说明Description
Service Fabric 服务Service Fabric Service 特定于 Azure Service Fabric Service Remoting 的计数器,例如,处理请求所需的平均时间Counters specific to Azure Service Fabric Service Remoting , for example, average time taken to process request
Service Fabric 服务方法Service Fabric Service Method 特定于 Service Fabric Remoting Service 所实现方法的计数器,例如,调用服务方法的频率Counters specific to methods implemented by Service Fabric Remoting Service, for example, how often a service method is invoked

以上每个类别都有一个或多个计数器。Each of the preceding categories has one or more counters.

默认情况下在 Windows 操作系统中提供的 Windows 性能监视器 应用程序可用于收集和查看性能计数器数据。The Windows Performance Monitor application that is available by default in the Windows operating system can be used to collect and view performance counter data. Azure 诊断是用于收集性能计数器数据并将其上传到 Azure 表的另一个选项。Azure Diagnostics is another option for collecting performance counter data and uploading it to Azure tables.

性能计数器实例名称Performance counter instance names

包含大量 ServiceRemoting 服务或分区的群集具有大量性能计数器实例。A cluster that has a large number of ServiceRemoting services or partitions have a large number of performance counter instances. 性能计数器实例名称有助于标识与性能计数器实例相关联的特定分区和服务方法(如果适用)。The performance counter instance names can help in identifying the specific partition and Service method (if applicable) that the performance counter instance is associated with.

Service Fabric 服务类别Service Fabric Service category

对于类别 Service Fabric Service,计数器实例名称采用以下格式:For the category Service Fabric Service, the counter instance names are in the following format:

ServiceFabricPartitionID_ServiceReplicaOrInstanceId_ServiceRuntimeInternalID

ServiceFabricPartitionID 是与性能计数器实例相关联的 Service Fabric 分区 ID 的字符串表示。ServiceFabricPartitionID is the string representation of the Service Fabric partition ID that the performance counter instance is associated with. 分区 ID 是 GUID,并且其字符串表示形式通过使用格式说明符“D”的 Guid.ToString 方法生成。The partition ID is a GUID, and its string representation is generated through the Guid.ToString method with format specifier "D".

ServiceReplicaOrInstanceId 是与性能计数器实例相关联的 Service Fabric 副本/实例 ID 的字符串表示形式。ServiceReplicaOrInstanceId is the string representation of the Service Fabric Replica/Instance ID that the performance counter instance is associated with.

ServiceRuntimeInternalID 是由 Fabric 服务运行时生成的供内部使用的 64 位整数的字符串表示形式。ServiceRuntimeInternalID is the string representation of a 64-bit integer that is generated by the Fabric Service runtime for its internal use. 这包括在性能计数器实例名称中,以确保其唯一性并避免与其他性能计数器实例名称发生冲突。This is included in the performance counter instance name to ensure its uniqueness and avoid conflict with other performance counter instance names. 用户不应尝试解释此部分的性能计数器实例名称。Users should not try to interpret this portion of the performance counter instance name.

下面是属于 Service Fabric Service 类别的计数器的计数器实例名称的示例:The following is an example of a counter instance name for a counter that belongs to the Service Fabric Service category:

2740af29-78aa-44bc-a20b-7e60fb783264_635650083799324046_5008379932

在前面的示例中,2740af29-78aa-44bc-a20b-7e60fb783264 是 Service Fabric 分区 ID 的字符串表示形式,635650083799324046 是副本/实例 ID 的字符串表示形式,5008379932 是运行时生成的供内部使用的 64 位 ID。In the preceding example, 2740af29-78aa-44bc-a20b-7e60fb783264 is the string representation of the Service Fabric partition ID, 635650083799324046 is string representation of Replica/InstanceId and 5008379932 is the 64-bit ID that is generated for the runtime's internal use.

Service Fabric 服务方法类别Service Fabric Service Method category

对于类别 Service Fabric Service Method,计数器实例名称采用以下格式:For the category Service Fabric Service Method, the counter instance names are in the following format:

MethodName_ServiceRuntimeMethodId_ServiceFabricPartitionID_ServiceReplicaOrInstanceId_ServiceRuntimeInternalID

MethodName 是与性能计数器实例相关联的服务方法的名称。MethodName is the name of the service method that the performance counter instance is associated with. 方法名称的格式是根据 Fabric 服务运行时中的一些逻辑来确定的,该逻辑可以平衡名称的可读性和 Windows 上对性能计数器实例名称的最大长度的约束。The format of the method name is determined based on some logic in the Fabric Service runtime that balances the readability of the name with constraints on the maximum length of the performance counter instance names on Windows.

ServiceRuntimeMethodId 是由 Fabric 服务运行时生成的供内部使用的 32 位整数的字符串表示形式。ServiceRuntimeMethodId is the string representation of a 32-bit integer that is generated by the Fabric Service runtime for its internal use. 这包括在性能计数器实例名称中,以确保其唯一性并避免与其他性能计数器实例名称发生冲突。This is included in the performance counter instance name to ensure its uniqueness and avoid conflict with other performance counter instance names. 用户不应尝试解释此部分的性能计数器实例名称。Users should not try to interpret this portion of the performance counter instance name.

ServiceFabricPartitionID 是与性能计数器实例关联的 Service Fabric 分区 ID 的字符串表示形式。ServiceFabricPartitionID is the string representation of the Service Fabric partition ID that the performance counter instance is associated with. 分区 ID 是 GUID,并且其字符串表示形式通过使用格式说明符“D”的 Guid.ToString 方法生成。The partition ID is a GUID, and its string representation is generated through the Guid.ToString method with format specifier "D".

ServiceReplicaOrInstanceId 是与性能计数器实例相关联的 Service Fabric 副本/实例 ID 的字符串表示形式。ServiceReplicaOrInstanceId is the string representation of the Service Fabric Replica/Instance ID that the performance counter instance is associated with.

ServiceRuntimeInternalID 是由 Fabric 服务运行时生成的供内部使用的 64 位整数的字符串表示形式。ServiceRuntimeInternalID is the string representation of a 64-bit integer that is generated by the Fabric Service runtime for its internal use. 这包括在性能计数器实例名称中,以确保其唯一性并避免与其他性能计数器实例名称发生冲突。This is included in the performance counter instance name to ensure its uniqueness and avoid conflict with other performance counter instance names. 用户不应尝试解释此部分的性能计数器实例名称。Users should not try to interpret this portion of the performance counter instance name.

下面是属于 Service Fabric Service Method 类别的计数器的计数器实例名称的示例:The following is an example of a counter instance name for a counter that belongs to the Service Fabric Service Method category:

ivoicemailboxservice.leavemessageasync_2_89383d32-e57e-4a9b-a6ad-57c6792aa521_635650083804480486_5008380

在前面的示例中,ivoicemailboxservice.leavemessageasync 是方法名称,2 是运行时生成的供内部使用的 32 位 ID,89383d32-e57e-4a9b-a6ad-57c6792aa521 是 Service Fabric 分区 ID 的字符串表示形式,635650083804480486 是 Service Fabric 副本/实例 ID 的字符串表示形式,5008380 是运行时生成的供内部使用的 64 位 ID。In the preceding example, ivoicemailboxservice.leavemessageasync is the method name, 2 is the 32-bit ID generated for the runtime's internal use, 89383d32-e57e-4a9b-a6ad-57c6792aa521 is the string representation of the Service Fabric partition ID,635650083804480486 is the string representation of the Service Fabric Replica/Instance ID and 5008380 is the 64-bit ID generated for the runtime's internal use.

性能计数器列表List of Performance counters

服务方法性能计数器Service method performance counters

Reliable Service 运行时发布与执行服务方法相关的下列性能计数器。The Reliable Service runtime publishes the following performance counters related to the execution of service methods.

类别名称Category name 计数器名称Counter name 说明Description
Service Fabric 服务方法Service Fabric Service Method 调用/秒Invocations/Sec 每秒调用服务方法的次数Number of times that the service method is invoked per second
Service Fabric 服务方法Service Fabric Service Method 每次调用的平均毫秒数Average milliseconds per invocation 执行服务方法所用的时间(以毫秒为单位)Time taken to execute the service method in milliseconds
Service Fabric 服务方法Service Fabric Service Method 引发的异常数/秒Exceptions thrown/Sec 服务方法每秒引发异常的次数Number of times that the service method threw an exception per second

服务请求处理的性能计数器Service request processing performance counters

客户端通过服务代理对象调用方法时,会通过网络向远程服务发送请求消息。When a client invokes a method via a service proxy object, it results in a request message being sent over the network to the remoting service. 该服务处理此请求消息并向客户端返回响应。The service processes the request message and sends a response back to the client. Reliable ServiceRemoting 运行时发布以下与服务请求处理相关的性能计数器。The Reliable ServiceRemoting runtime publishes the following performance counters related to service request processing.

类别名称Category name 计数器名称Counter name 说明Description
Service Fabric 服务Service Fabric Service 未完成的请求数# of outstanding requests 正在服务中处理的请求数Number of requests being processed in the service
Service Fabric 服务Service Fabric Service 每个请求的平均毫秒数Average milliseconds per request 服务处理请求所用时间(以毫秒为单位)Time taken (in milliseconds) by the service to process a request
Service Fabric 服务Service Fabric Service 反序列化请求的平均毫秒数Average milliseconds for request deserialization 服务收到服务请求消息时,对此请求消息进行反序列化所用的时间(以毫秒为单位)Time taken (in milliseconds) to deserialize service request message when it is received at the service
Service Fabric 服务Service Fabric Service 序列化响应的平均毫秒数Average milliseconds for response serialization 将响应发送到客户端之前,在服务中序列化服务响应消息所用的时间(以毫秒为单位)Time taken (in milliseconds) to serialize the service response message at the service before the response is sent to the client

后续步骤Next steps