/**
		 * Helper function for handling updating actor summaries as they require a bit more work.
		 * 
		 * @param	NetworkStream			NetworkStream associated with token
		 * @param	TokenReplicateActor		Actor token
		 */
		private static void HandleActorSummary(NetworkStream NetworkStream, TokenReplicateActor TokenReplicateActor )
		{
			if ( TokenReplicateActor != null )
			{
				int ClassNameIndex = NetworkStream.GetClassNameIndex(TokenReplicateActor.ActorNameIndex);
                NetworkStream.UpdateSummary(ref NetworkStream.ActorNameToSummary, ClassNameIndex, TokenReplicateActor.GetNumReplicatedBits( new FilterValues() ), TokenReplicateActor.TimeInMS );
			}
		}
Beispiel #2
0
 /**
  * Helper function for handling updating actor summaries as they require a bit more work.
  *
  * @param	NetworkStream			NetworkStream associated with token
  * @param	TokenReplicateActor		Actor token
  */
 private static void HandleActorSummary(NetworkStream NetworkStream, TokenReplicateActor TokenReplicateActor)
 {
     if (TokenReplicateActor != null)
     {
         int ClassNameIndex = NetworkStream.GetClassNameIndex(TokenReplicateActor.ActorNameIndex);
         NetworkStream.UpdateSummary(ref NetworkStream.ActorNameToSummary, ClassNameIndex, TokenReplicateActor.GetNumReplicatedBits("", "", ""), TokenReplicateActor.TimeInMS);
     }
 }
        /**
         * Dumps actor/property tokens into a tree view for viewing performance timings
         */
        public void ToActorPerformanceView(NetworkStream NetworkStream, TreeView TreeView, string ActorFilter, string PropertyFilter, string RPCFilter)
        {
            UniqueItemTracker <UniqueActor, TokenReplicateActor> UniqueActors = new UniqueItemTracker <UniqueActor, TokenReplicateActor>();

            foreach (TokenBase Token in Tokens)
            {
                TokenReplicateActor ActorToken = Token as TokenReplicateActor;

                if (ActorToken == null)
                {
                    continue;
                }

                UniqueActors.AddItem(ActorToken, NetworkStream.GetClassNameIndex(ActorToken.ActorNameIndex));
            }

            var ActorDetailList = UniqueActors.UniqueItems.OrderByDescending(s => s.Value.TimeInMS).ToList();

            TreeView.Nodes.Clear();

            foreach (var UniqueActor in ActorDetailList)
            {
                long   NumActorBytes = (UniqueActor.Value.SizeBits + 7) / 8;
                string ActorStr      = string.Format("{0,-32} : {1:0.00} ({2:000}) ({3:000})", NetworkStream.GetName(UniqueActor.Key), UniqueActor.Value.TimeInMS, NumActorBytes, UniqueActor.Value.Count);
                TreeView.Nodes.Add(ActorStr);

                var PropertyDetailList = UniqueActor.Value.Properties.UniqueItems.OrderByDescending(s => s.Value.SizeBits).ToList();

                foreach (var Property in PropertyDetailList)
                {
                    long   NumPropBytes = (Property.Value.SizeBits + 7) / 8;
                    string PropName     = NetworkStream.GetName(Property.Key);

                    string PropStr = string.Format("{0,-25} : {1:000} ({2:000})", PropName, NumPropBytes, Property.Value.Count);
                    TreeView.Nodes[TreeView.Nodes.Count - 1].Nodes.Add(PropStr);
                }
            }
        }
Beispiel #4
0
 public int GetClassNameIndex()
 {
     return(NetworkStream.GetClassNameIndex(ActorNameIndex));
 }
        public string[] ToActorPerformanceString(NetworkStream NetworkStream, string ActorFilter, string PropertyFilter, string RPCFilter)
        {
            var Details = new List <string>();

            UniqueItemTracker <UniqueActor, TokenReplicateActor> UniqueActors = new UniqueItemTracker <UniqueActor, TokenReplicateActor>();

            foreach (TokenBase Token in Tokens)
            {
                TokenReplicateActor ActorToken = Token as TokenReplicateActor;

                if (ActorToken == null)
                {
                    continue;
                }

                UniqueActors.AddItem(ActorToken, NetworkStream.GetClassNameIndex(ActorToken.ActorNameIndex));
            }

            var ActorDetailList = UniqueActors.UniqueItems.OrderByDescending(s => s.Value.TimeInMS).ToList();

            Int32 NumActors    = 0;
            long  NumSentBytes = 0;
            float TotalMS      = 0.0f;

            foreach (var UniqueActor in ActorDetailList)
            {
                NumActors += UniqueActor.Value.Count;
                TotalMS   += UniqueActor.Value.TimeInMS;
                var PropertyDetailList = UniqueActor.Value.Properties.UniqueItems.OrderByDescending(s => s.Value.SizeBits).ToList();

                foreach (var Property in PropertyDetailList)
                {
                    NumSentBytes += (Property.Value.SizeBits + 7) / 8;
                }
            }

            Details.Add("Total Actors  : " + NumActors.ToString());
            Details.Add("Total MS      : " + string.Format("{0:0.00}", TotalMS));
            Details.Add("Sent Bytes    : " + NumSentBytes.ToString());

            foreach (var UniqueActor in ActorDetailList)
            {
                long   NumActorBytes = (UniqueActor.Value.SizeBits + 7) / 8;
                string ActorStr      = string.Format("{0,-34} : {1:0.00} ({2,4}) ({3,2})", NetworkStream.GetName(UniqueActor.Key), UniqueActor.Value.TimeInMS, NumActorBytes, UniqueActor.Value.Count);
                Details.Add(ActorStr);

                var PropertyDetailList = UniqueActor.Value.Properties.UniqueItems.OrderByDescending(s => s.Value.SizeBits).ToList();

                foreach (var Property in PropertyDetailList)
                {
                    long   NumPropBytes = (Property.Value.SizeBits + 7) / 8;
                    string PropName     = NetworkStream.GetName(Property.Key);

                    string PropStr = string.Format("{0,-22} : {1,4} ({2,2})", PropName, NumPropBytes, Property.Value.Count);
                    Details.Add("   " + PropStr);
                }
                Details.Add("-----------------------------------");
            }

            return(Details.ToArray());
        }