You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/Tests/TestPipeLine/Watcher/WatcherService.cs

47 lines
1.7 KiB

5 years ago
using System;
using System.Linq;
using System.Text;
using ZeroLevel;
using ZeroLevel.Network;
using ZeroLevel.Services.Applications;
namespace Watcher
{
public class WatcherService
: BaseZeroService
{
protected override void StartAction()
{
ReadServiceInfo();
5 years ago
5 years ago
Sheduller.RemindEvery(TimeSpan.FromMilliseconds(350), () =>
{
var sb = new StringBuilder();
5 years ago
sb.AppendLine("Discovery table");
5 years ago
sb.AppendLine("—————————————————————————————————————————————————————————————————————————");
5 years ago
foreach (var record in Exchange.DiscoveryStorage.GetAll())
5 years ago
{
5 years ago
sb.AppendLine($"\t{record.Key}:\t{record.Value.Address}:{record.Value.Port}");
5 years ago
}
5 years ago
sb.AppendLine("Routing table");
sb.AppendLine("—————————————————————————————————————————————————————————————————————————");
5 years ago
5 years ago
foreach (var record in Exchange.RoutesStorage.GetAll())
5 years ago
{
5 years ago
sb.AppendLine($"\t{record.Key}:\t{record.Value.Address}:{record.Value.Port}");
5 years ago
}
sb.AppendLine();
Console.Clear();
Console.WriteLine($"Watch info: \r\n{sb}");
});
}
protected override void StopAction()
{
}
}
}

Powered by TurnKey Linux.