/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/TelemetryConsumption/Http/HttpMetrics.cs
76 строк
2 KB
Miha Zupan
React to runtime EventSource changes (#2268)
03 окт 2023, 20:55
Не верифицирован
03 окт 2023, 20:55
87bb512
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; namespace Yarp.Telemetry.Consumption; /// <summary> /// Represents metrics reported by the System.Net.Http event counters. /// </summary> public sealed class HttpMetrics { public HttpMetrics() => Timestamp = DateTime.UtcNow; /// <summary> /// Timestamp of when this <see cref="KestrelMetrics"/> instance was created. /// </summary> public DateTime Timestamp { get; internal set; } /// <summary> /// Number of HTTP requests started since telemetry was enabled. /// </summary> public long RequestsStarted { get; internal set; } /// <summary> /// Number of HTTP requests started in the last metrics interval. /// </summary> public long RequestsStartedRate { get; internal set; } /// <summary> /// Number of HTTP requests that failed since telemetry was enabled. /// </summary> public long RequestsFailed { get; internal set; } /// <summary> /// Number of HTTP requests that failed in the last metrics interval. /// </summary> public long RequestsFailedRate { get; internal set; } /// <summary> /// Number of active HTTP requests that have started but not yet completed or failed. /// </summary> public long CurrentRequests { get; internal set; } /// <summary> /// Number of currently open HTTP 1.1 connections. /// </summary> public long CurrentHttp11Connections { get; internal set; } /// <summary> /// Number of currently open HTTP 2.0 connections. /// </summary> public long CurrentHttp20Connections { get; internal set; } /// <summary> /// Average time spent on queue for HTTP 1.1 requests that hit the MaxConnectionsPerServer limit in the last metrics interval. /// </summary> public TimeSpan Http11RequestsQueueDuration { get; internal set; } /// <summary> /// Average time spent on queue for HTTP 2.0 requests that hit the MAX_CONCURRENT_STREAMS limit on the connection in the last metrics interval. /// </summary> public TimeSpan Http20RequestsQueueDuration { get; internal set; } #if NET8_0_OR_GREATER /// <summary> /// Number of currently open HTTP 3.0 connections. /// </summary> public long CurrentHttp30Connections { get; internal set; } /// <summary> /// Average time spent on queue for HTTP 3.0 requests in the last metrics interval. /// </summary> public TimeSpan Http30RequestsQueueDuration { get; internal set; } #endif }