Lines Matching refs:HealthCheckResponse
46 private readonly Dictionary<string, HealthCheckResponse.Types.ServingStatus> statusMap =
47 new Dictionary<string, HealthCheckResponse.Types.ServingStatus>();
51 private readonly Dictionary<string, List<ChannelWriter<HealthCheckResponse>>> watchers =
52 new Dictionary<string, List<ChannelWriter<HealthCheckResponse>>>();
60 public void SetStatus(string service, HealthCheckResponse.Types.ServingStatus status) in SetStatus()
62 HealthCheckResponse.Types.ServingStatus previousStatus; in SetStatus()
83 HealthCheckResponse.Types.ServingStatus previousStatus; in ClearStatus()
91 if (previousStatus != HealthCheckResponse.Types.ServingStatus.ServiceUnknown) in ClearStatus()
93 NotifyStatus(service, HealthCheckResponse.Types.ServingStatus.ServiceUnknown); in ClearStatus()
103 List<KeyValuePair<string, HealthCheckResponse.Types.ServingStatus>> statuses; in ClearAll()
111 … foreach (KeyValuePair<string, HealthCheckResponse.Types.ServingStatus> status in statuses) in ClearAll()
113 if (status.Value != HealthCheckResponse.Types.ServingStatus.ServiceUnknown) in ClearAll()
115 … NotifyStatus(status.Key, HealthCheckResponse.Types.ServingStatus.ServiceUnknown); in ClearAll()
127 …public override Task<HealthCheckResponse> Check(HealthCheckRequest request, ServerCallContext cont… in Check()
129 … HealthCheckResponse response = GetHealthCheckResponse(request.Service, throwOnNotFound: true); in Check()
156 …e async Task Watch(HealthCheckRequest request, IServerStreamWriter<HealthCheckResponse> responseSt… in Watch()
166 …Channel<HealthCheckResponse> channel = Channel.CreateBounded<HealthCheckResponse>(new BoundedChann… in Watch()
174 … if (!watchers.TryGetValue(service, out List<ChannelWriter<HealthCheckResponse>> channelWriters)) in Watch()
176 channelWriters = new List<ChannelWriter<HealthCheckResponse>>(); in Watch()
187 … if (watchers.TryGetValue(service, out List<ChannelWriter<HealthCheckResponse>> channelWriters)) in Watch()
206 HealthCheckResponse response = GetHealthCheckResponse(service, throwOnNotFound: false); in Watch()
213 if (channel.Reader.TryRead(out HealthCheckResponse item)) in Watch()
220 private void NotifyStatus(string service, HealthCheckResponse.Types.ServingStatus status) in NotifyStatus()
224 … if (watchers.TryGetValue(service, out List<ChannelWriter<HealthCheckResponse>> channelWriters)) in NotifyStatus()
226 HealthCheckResponse response = new HealthCheckResponse { Status = status }; in NotifyStatus()
228 foreach (ChannelWriter<HealthCheckResponse> writer in channelWriters) in NotifyStatus()
240 private HealthCheckResponse GetHealthCheckResponse(string service, bool throwOnNotFound) in GetHealthCheckResponse()
242 HealthCheckResponse response = null; in GetHealthCheckResponse()
245 HealthCheckResponse.Types.ServingStatus status; in GetHealthCheckResponse()
255 status = HealthCheckResponse.Types.ServingStatus.ServiceUnknown; in GetHealthCheckResponse()
258 response = new HealthCheckResponse { Status = status }; in GetHealthCheckResponse()
264 private HealthCheckResponse.Types.ServingStatus GetServiceStatus(string service) in GetServiceStatus()
266 if (statusMap.TryGetValue(service, out HealthCheckResponse.Types.ServingStatus s)) in GetServiceStatus()
273 return HealthCheckResponse.Types.ServingStatus.ServiceUnknown; in GetServiceStatus()