8
8
using System ;
9
9
using System . Collections . Generic ;
10
10
using System . Collections . Immutable ;
11
+ using System . Globalization ;
11
12
using System . Linq ;
12
13
using Akka . Actor ;
13
14
using Akka . Event ;
@@ -43,8 +44,7 @@ protected override void OnReceive(object message)
43
44
switch ( message )
44
45
{
45
46
case ClusterHeartbeatSender . Heartbeat hb :
46
- // TODO log the sequence nr once serializer is enabled
47
- if ( VerboseHeartbeat ) _cluster . CurrentInfoLogger . LogDebug ( "Heartbeat from [{0}]" , hb . From ) ;
47
+ if ( VerboseHeartbeat ) _cluster . CurrentInfoLogger . LogDebug ( $ "Heartbeat from [{ hb . From } ] - Sequence number [{ hb . SequenceNr . ToString ( CultureInfo . InvariantCulture ) } ]") ;
48
48
Sender . Tell ( new ClusterHeartbeatSender . HeartbeatRsp ( _cluster . SelfUniqueAddress ,
49
49
hb . SequenceNr , hb . CreationTimeNanos ) ) ;
50
50
break ;
@@ -58,7 +58,6 @@ public static Props Props(Cluster getCluster)
58
58
{
59
59
return Akka . Actor . Props . Create ( ( ) => new ClusterHeartbeatReceiver ( getCluster ) ) ;
60
60
}
61
-
62
61
}
63
62
64
63
/// <summary>
@@ -248,7 +247,8 @@ private void CheckTickInterval()
248
247
"Previous heartbeat was sent [{1}] ms ago, expected interval is [{2}] ms. This may cause failure detection " +
249
248
"to mark members as unreachable. The reason can be thread starvation, e.g. by running blocking tasks on the " +
250
249
"default dispatcher, CPU overload, or GC." ,
251
- _cluster . SelfAddress , ( now - _tickTimestamp ) . TotalMilliseconds , _cluster . Settings . HeartbeatInterval . TotalMilliseconds ) ;
250
+ _cluster . SelfAddress , ( now - _tickTimestamp ) . TotalMilliseconds . ToString ( CultureInfo . InvariantCulture ) ,
251
+ _cluster . Settings . HeartbeatInterval . TotalMilliseconds . ToString ( CultureInfo . InvariantCulture ) ) ;
252
252
}
253
253
254
254
_tickTimestamp = DateTime . UtcNow ;
@@ -258,8 +258,8 @@ private void DoHeartbeatRsp(HeartbeatRsp rsp)
258
258
{
259
259
if ( _cluster . Settings . VerboseHeartbeatLogging )
260
260
{
261
- // TODO: log response time and validate sequence nrs once serialisation of sendTime is released
262
- _log . Debug ( "Cluster Node [{0}] - Heartbeat response from [{1}]" , _cluster . SelfAddress , rsp . From . Address ) ;
261
+ _log . Debug ( "Cluster Node [{0}] - Heartbeat response from [{1}] - Sequence number [{2}] - Creation time [{3}]" , _cluster . SelfAddress , rsp . From . Address ,
262
+ rsp . SequenceNr . ToString ( CultureInfo . InvariantCulture ) , rsp . CreationTimeNanos . ToString ( CultureInfo . InvariantCulture ) ) ;
263
263
}
264
264
_state = _state . HeartbeatRsp ( rsp . From ) ;
265
265
}
@@ -768,5 +768,4 @@ public int Compare(UniqueAddress x, UniqueAddress y)
768
768
}
769
769
#endregion
770
770
}
771
- }
772
-
771
+ }
0 commit comments