Skip to content

Commit e18b9cf

Browse files
committed
Merge branch 'develop' into release-1.0.0
2 parents bdbbdf2 + 713c4e4 commit e18b9cf

29 files changed

+231
-98
lines changed

src/ServiceControl.AcceptanceTests/HeartbeatMonitoring/When_an_endpoint_starts_up.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using NServiceBus.Config;
88
using NServiceBus.Unicast;
99
using NUnit.Framework;
10-
using ServiceControl.Contracts.HeartbeatMonitoring;
10+
using ServiceControl.Contracts.EndpointControl;
1111
using ServiceControl.EventLog;
1212

1313
public class When_an_endpoint_starts_up : AcceptanceTest

src/ServiceControl/CompositeViews/Endpoints/EndpointsView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ public class EndpointsView
77
public Guid Id { get; set; }
88
public string Name { get; set; }
99
public string HostDisplayName { get; set; }
10+
11+
public bool Monitored { get; set; }
12+
1013
public bool MonitorHeartbeat { get; set; }
1114
public string LicenseStatus { get; set; }
1215
public HeartbeatInformation HeartbeatInformation { get; set; }
16+
public bool IsSendingHeartbeats { get; set; }
1317
}
1418
}

src/ServiceControl/CompositeViews/Endpoints/GetEndpoints.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public GetEndpoints()
3939
return HttpStatusCode.NotFound;
4040
}
4141

42-
if (data.MonitorHeartbeat == endpoint.MonitorHeartbeat)
42+
if (data.MonitorHeartbeat == endpoint.Monitored)
4343
{
4444
return HttpStatusCode.NotModified;
4545
}
@@ -79,7 +79,8 @@ public GetEndpoints()
7979
Id = knownEndpoint.Id,
8080
Name = knownEndpoint.EndpointDetails.Name,
8181
HostDisplayName = knownEndpoint.HostDisplayName,
82-
MonitorHeartbeat = knownEndpoint.MonitorHeartbeat,
82+
Monitored = knownEndpoint.Monitored,
83+
MonitorHeartbeat = true,
8384
LicenseStatus = LicenseStatusKeeper.Get(knownEndpoint.EndpointDetails.Name + knownEndpoint.HostDisplayName)
8485
};
8586

@@ -91,6 +92,10 @@ public GetEndpoints()
9192
return;
9293
}
9394

95+
view.IsSendingHeartbeats = true;
96+
97+
view.MonitorHeartbeat = !heartbeat.Disabled;
98+
9499
view.HeartbeatInformation =
95100
new HeartbeatInformation
96101
{

src/ServiceControl/CompositeViews/Endpoints/KnownEndpointIndex.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public KnownEndpointIndex()
1313
{
1414
EndpointDetails = message.EndpointDetails,
1515
HostDisplayName = message.HostDisplayName,
16-
MonitorHeartbeat = message.MonitorHeartbeat,
16+
Monitored = message.Monitored,
1717
};
1818

1919
DisableInMemoryIndexing = true;

src/ServiceControl/CompositeViews/Endpoints/KnownEndpointUpdateHandler.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public void Handle(EnableEndpointMonitoring message)
2121
throw new Exception("No endpoint with found with id: " + message.EndpointId);
2222
}
2323

24-
knownEndpoint.MonitorHeartbeat = true;
24+
knownEndpoint.Monitored = true;
2525

2626
Session.Store(knownEndpoint);
2727

2828
Bus.Publish(new MonitoringEnabledForEndpoint
2929
{
30-
EndpointId = message.EndpointId,
30+
EndpointInstanceId = message.EndpointId,
3131
Endpoint = knownEndpoint.EndpointDetails
3232
});
3333
}
@@ -41,13 +41,13 @@ public void Handle(DisableEndpointMonitoring message)
4141
throw new Exception("No endpoint with found with id: " + message.EndpointId);
4242
}
4343

44-
knownEndpoint.MonitorHeartbeat = false;
44+
knownEndpoint.Monitored = false;
4545

4646
Session.Store(knownEndpoint);
4747

4848
Bus.Publish(new MonitoringDisabledForEndpoint
4949
{
50-
EndpointId = message.EndpointId,
50+
EndpointInstanceId = message.EndpointId,
5151
Endpoint = knownEndpoint.EndpointDetails
5252
});
5353
}

src/ServiceControl/Contracts/HeartbeatMonitoring/EndpointStarted.cs renamed to src/ServiceControl/Contracts/EndpointControl/EndpointStarted.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
namespace ServiceControl.Contracts.HeartbeatMonitoring
1+
namespace ServiceControl.Contracts.EndpointControl
22
{
33
using System;
44
using NServiceBus;
5+
using Operations;
56

67
public class EndpointStarted : IEvent
78
{
8-
public Guid HostId { get; set; }
9-
public string Endpoint { get; set; }
9+
public EndpointDetails EndpointDetails { get; set; }
1010
public DateTime StartedAt { get; set; }
1111
}
1212
}

src/ServiceControl/Contracts/EndpointControl/MonitoringDisabledForEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ServiceControl.EndpointControl.Contracts
66

77
public class MonitoringDisabledForEndpoint : IEvent
88
{
9-
public Guid EndpointId { get; set; }
9+
public Guid EndpointInstanceId { get; set; }
1010

1111
public EndpointDetails Endpoint { get; set; }
1212
}

src/ServiceControl/Contracts/EndpointControl/MonitoringEnabledForEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ServiceControl.EndpointControl.Contracts
66

77
public class MonitoringEnabledForEndpoint : IEvent
88
{
9-
public Guid EndpointId { get; set; }
9+
public Guid EndpointInstanceId { get; set; }
1010

1111
public EndpointDetails Endpoint { get; set; }
1212
}

src/ServiceControl/Contracts/HeartbeatMonitoring/EndpointFailedToHeartbeat.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
namespace ServiceControl.Contracts.HeartbeatMonitoring
22
{
33
using System;
4-
using NServiceBus;
54
using Operations;
65

7-
public class EndpointFailedToHeartbeat : IEvent
6+
public class EndpointFailedToHeartbeat : HeartbeatStatusChanged
87
{
98
public EndpointDetails Endpoint { get; set; }
109
public DateTime LastReceivedAt { get; set; }

src/ServiceControl/Contracts/HeartbeatMonitoring/EndpointHeartbeatRestored.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
namespace ServiceControl.Contracts.HeartbeatMonitoring
22
{
33
using System;
4-
using NServiceBus;
54
using Operations;
65

7-
public class EndpointHeartbeatRestored : IEvent
6+
public class EndpointHeartbeatRestored : HeartbeatStatusChanged
87
{
98
public EndpointDetails Endpoint { get; set; }
109
public DateTime RestoredAt { get; set; }

0 commit comments

Comments
 (0)