Processing health status messages

Each microservice will send a health status message to let us know it's alright and working properly. As the microservice manager, it's our responsibility to track this, log the information, and trigger alerts if necessary. The health status message will also send us the amount of memory it is using as well as the CPU usage:

bool ProcessHealthMessage([NotNull] HealthStatusMessage msg)
{
Console.WriteLine("Received Health Status Message");
RILogManager.Default?.SendInformation("Received Health Status Message");
RILogManager.Default?.SendInformation(msg.serviceName);
RILogManager.Default?.SendInformation(msg.status.ToString());
RILogManager.Default?.SendInformation(ToBytes(msg.memoryUsed));
RILogManager.Default?.SendInformation(msg.CPU.ToString());
RILogManager.Default?.SendInformation(msg.message);
Console.WriteLine(msg.serviceName);
Console.WriteLine(msg.status.ToString());
Console.WriteLine(ToBytes(msg.memoryUsed));
Console.WriteLine(msg.CPU.ToString());
Console.WriteLine(msg.message);
return true;
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset