-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4720 from Particular/connector_heartbeat
- Loading branch information
Showing
16 changed files
with
79 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/ServiceControl.Persistence.RavenDB/ConnectedApplicationsDataStore.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
...viceControl.Persistence.Tests.RavenDB/ConnectedApplications/ConnectedApplicationsTests.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/ServiceControl.Persistence/IConnectedApplicationsDataStore.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...eControl/Monitoring/HeartbeatMonitoring/InternalMessages/MassTransitConnectorHeartbeat.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace ServiceControl.Connector.MassTransit; | ||
|
||
using System; | ||
using NServiceBus; | ||
|
||
public class MassTransitConnectorHeartbeat : IMessage | ||
{ | ||
public required string Version { get; set; } | ||
public required ErrorQueue[] ErrorQueues { get; set; } | ||
public required LogEntry[] Logs { get; set; } | ||
public required DateTimeOffset SentDateTimeOffset { get; set; } | ||
} | ||
|
||
#pragma warning disable CA1711 | ||
public class ErrorQueue | ||
#pragma warning restore CA1711 | ||
{ | ||
public required string Name { get; set; } | ||
public required bool Ingesting { get; set; } | ||
} | ||
|
||
public class LogEntry | ||
{ | ||
public string Message { get; set; } | ||
public DateTimeOffset Date { get; set; } | ||
public string Level { get; set; } | ||
} |
11 changes: 11 additions & 0 deletions
11
src/ServiceControl/Monitoring/HeartbeatMonitoring/MassTransitConnectorHeartbeatStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#nullable enable | ||
namespace ServiceControl.Monitoring.HeartbeatMonitoring; | ||
|
||
using Connector.MassTransit; | ||
|
||
public class MassTransitConnectorHeartbeatStatus | ||
{ | ||
public MassTransitConnectorHeartbeat? LastHeartbeat { get; private set; } | ||
|
||
public void Update(MassTransitConnectorHeartbeat lastHeartbeat) => LastHeartbeat = lastHeartbeat; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/ServiceControl/Monitoring/Transport/MassTransitConnectorHeartbeatHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace ServiceControl.Monitoring; | ||
|
||
using System.Threading.Tasks; | ||
using Connector.MassTransit; | ||
using HeartbeatMonitoring; | ||
using NServiceBus; | ||
|
||
class MassTransitConnectorHeartbeatHandler(MassTransitConnectorHeartbeatStatus connectorHeartbeatStatus) : IHandleMessages<MassTransitConnectorHeartbeat> | ||
{ | ||
public Task Handle(MassTransitConnectorHeartbeat message, IMessageHandlerContext context) | ||
{ | ||
if (connectorHeartbeatStatus.LastHeartbeat == null || message.SentDateTimeOffset > connectorHeartbeatStatus.LastHeartbeat.SentDateTimeOffset) | ||
{ | ||
connectorHeartbeatStatus.Update(message); | ||
} | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.