remove stopwatch from health check

This commit is contained in:
askmeegs 2019-08-19 09:25:43 -04:00
parent 07c669a047
commit 99867ff168

View file

@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using static System.Diagnostics.Stopwatch;
using cartservice.interfaces;
using Grpc.Core;
using Grpc.Health.V1;
@ -15,13 +14,9 @@ namespace cartservice {
}
public override Task<HealthCheckResponse> Check(HealthCheckRequest request, ServerCallContext context){
var watch = StartNew();
var result = Task.FromResult(new HealthCheckResponse {
Status = dependency.Ping() ? HealthCheckResponse.Types.ServingStatus.Serving : HealthCheckResponse.Types.ServingStatus.NotServing
});
watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds;
Console.WriteLine ("✅ Health Check took " + elapsedMs + "ms");
return result;
}
}