Skip to content

Commit

Permalink
feat: implement healt check service in mock
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem committed Dec 18, 2023
1 parent 66fff56 commit f936d95
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/csharp/ArmoniK.Api.Mock/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
app.MapGrpcService<Applications>();
app.MapGrpcService<Authentication>();
app.MapGrpcService<Events>();
app.MapGrpcService<HealthChecks>();
app.MapGrpcService<Partitions>();
app.MapGrpcService<Results>();
app.MapGrpcService<Sessions>();
Expand Down
43 changes: 43 additions & 0 deletions packages/csharp/ArmoniK.Api.Mock/Services/HealthChecks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// This file is part of the ArmoniK project
//
// Copyright (C) ANEO, 2021-2023.All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Threading.Tasks;

using ArmoniK.Api.gRPC.V1.HealthChecks;

using Grpc.Core;

namespace ArmoniK.Api.Mock.Services;

[Counting]
public class HealthChecks : HealthChecksService.HealthChecksServiceBase
{
[Count]
public override Task<CheckHealthResponse> CheckHealth(CheckHealthRequest request,
ServerCallContext context)
=> Task.FromResult(new CheckHealthResponse
{
Services =
{
new CheckHealthResponse.Types.ServiceHealth
{
Healthy = HealthStatusEnum.Healthy,
Message = "Mock is healthy",
Name = "mock",
},
},
});
}

0 comments on commit f936d95

Please sign in to comment.