< Summary

Class:SeungYongShim.Akka.OpenTelemetry.TraceLocalActorRef
Assembly:SeungYongShim.Akka.OpenTelemetry
File(s):/home/runner/work/SeungYongShim.Akka/SeungYongShim.Akka/src/SeungYongShim.Akka.OpenTelemetry/TraceLocalActorRef.cs
Covered lines:23
Uncovered lines:0
Coverable lines:23
Total lines:54
Line coverage:100% (23 of 23)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)
Tag:81_945672945

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)0%110100%
SendSystemMessage(...)66.67%992100%
NewActorCell(...)0%110100%

File(s)

/home/runner/work/SeungYongShim.Akka/SeungYongShim.Akka/src/SeungYongShim.Akka.OpenTelemetry/TraceLocalActorRef.cs

#LineLine coverage
 1using System;
 2using System.Diagnostics;
 3using Akka.Actor;
 4using Akka.Actor.Internal;
 5using Akka.Dispatch;
 6using Akka.Dispatch.SysMsg;
 7
 8namespace SeungYongShim.Akka.OpenTelemetry
 9{
 10
 11    public class TraceLocalActorRef : LocalActorRef
 12    {
 13        public TraceLocalActorRef(ActorSystemImpl system,
 14                                  Props props,
 15                                  MessageDispatcher dispatcher,
 16                                  MailboxType mailboxType,
 17                                  IInternalActorRef supervisor,
 18                                  ActorPath path,
 419                                  Type actorTaskSchedulerMessageType) : base(system, props, dispatcher, mailboxType, sup
 420        {
 421            ActorTaskSchedulerMessageType = actorTaskSchedulerMessageType;
 422        }
 23
 24        public Type ActorTaskSchedulerMessageType { get; }
 25        public TraceActorCell TraceActorCell { get; private set; }
 26
 27        public override void SendSystemMessage(ISystemMessage message)
 128        {
 129            if (ActorTaskSchedulerMessageType.IsInstanceOfType(message))
 130            {
 131                if (ActorTaskSchedulerMessageType.GetProperty("Exception")?
 132                                                 .GetValue(message) is Exception ex)
 133                {
 134                    var m = ActorTaskSchedulerMessageType.GetProperty("Message")?
 135                                                         .GetValue(message);
 36
 137                    message = (ISystemMessage)Activator.CreateInstance(ActorTaskSchedulerMessageType,
 138                                                                       new TraceException(ex), m);
 39
 140                    TraceActorCell.ActivityNew = Activity.Current?.Id;
 141                }
 142            }
 43
 144            base.SendSystemMessage(message);
 145        }
 46
 47        protected override ActorCell NewActorCell(ActorSystemImpl system, IInternalActorRef self, Props props,
 48            MessageDispatcher dispatcher, IInternalActorRef supervisor)
 449        {
 450            TraceActorCell = new TraceActorCell(system, self, props, dispatcher, supervisor);
 451            return TraceActorCell;
 452        }
 53    }
 54}