Esempio n. 1
0
        public Stats(string line, ExperimentalConfig config)
        {
            string[] s = line.Split(',');
            int frames = new CoreConfig().Frames.Length;

            mConfig = config;
            TimeStamp = DateTime.ParseExact(line.Split(',')[0], mConfig.TimestampFormat, new DateTimeFormatInfo());
        }
Esempio n. 2
0
        public Stats(string line, ExperimentalConfig config)
        {
            string[] s      = line.Split(',');
            int      frames = new CoreConfig().Frames.Length;

            mConfig   = config;
            TimeStamp = DateTime.ParseExact(line.Split(',')[0], mConfig.TimestampFormat, new DateTimeFormatInfo());
        }
Esempio n. 3
0
        public Stats(DateTime timestamp, ExperimentalConfig config)
        {
            mConfig = config;

            TimeStamp = timestamp;
        }
            public Stats(DateTime timestamp, ExperimentalConfig config)
            {
                mConfig = config;

                TimeStamp = timestamp;
            }
            public string ToString(ExperimentalConfig config, int count)
            {
                string line = base.ToString(count);

                foreach (var key in config.OutputKeys)
                    line += Get(key) + ",";

                return line.TrimEnd(',');
            }
            public ServerStats(string line, ExperimentalConfig config)
                : base(line, config)
            {
                string[] s = line.Split(',');
                int frames = new CoreConfig().Frames.Length;

                Dilation = 0f;
                SFPS = 0;
                Agents = 0;
                IncomingBPS = 0;
                OutgoingBPS = 0;
                ResentPackets = 0;
                ReceivedResends = 0;
                PhysicsFPS = 0f;
                AgentUpdates = 0f;
                Objects = 0;
                ScriptedObjects = 0;
                FrameTime = 0f;
                NetTime = 0f;
                ImageTime = 0f;
                PhysicsTime = 0f;
                ScriptTime = 0f;
                OtherTime = 0f;
                ChildAgents = 0;
                ActiveScripts = 0;

                for (int i = 0; i < mConfig.OutputKeys.Length; i++) {
                    switch (mConfig.OutputKeys[i]) {
                        case "FT": FrameTime = float.Parse(s[i + 2]); break;
                        case "SFPS": SFPS = int.Parse(s[i + 2]); break;
                    }
                }
            }
 public ServerStats(Simulator.SimStats stats, int frames, ExperimentalConfig config)
     : base(DateTime.Now, config)
 {
     Dilation = stats.Dilation;
     SFPS = stats.FPS;
     Agents = stats.Agents;
     IncomingBPS = stats.IncomingBPS;
     OutgoingBPS = stats.OutgoingBPS;
     ResentPackets = stats.ResentPackets;
     ReceivedResends = stats.ReceivedResends;
     PhysicsFPS = stats.PhysicsFPS;
     AgentUpdates = stats.AgentUpdates;
     Objects = stats.Objects;
     ScriptedObjects = stats.ScriptedObjects;
     FrameTime = stats.FrameTime;
     NetTime = stats.NetTime;
     ImageTime = stats.ImageTime;
     PhysicsTime = stats.PhysicsTime;
     ScriptTime = stats.ScriptTime;
     OtherTime = stats.OtherTime;
     ChildAgents = stats.ChildAgents;
     ActiveScripts = stats.ActiveScripts;
 }
            public ClientStats(string line, ExperimentalConfig config, DateTime timestamp)
                : base(timestamp, config)
            {
                string[] s = line.Split(',');
                int frames = new CoreConfig().Frames.Length;

                CFPS = new float[frames];
                Polys = new float[frames];
                Ping = new float[frames];

                AddLine(line, 0);
            }
            public ClientStats(string line, ExperimentalConfig config)
                : base(line, config)
            {
                string[] s = line.Split(',');
                int frames = new CoreConfig().Frames.Length;

                CFPS = new float[frames];
                Polys = new float[frames];
                Ping = new float[frames];

                for (int i = 0; i < mConfig.OutputKeys.Length; i++) {
                    switch (mConfig.OutputKeys[i]) {
                        case "CFPS": CFPS = s.Skip(i + 2).Take(frames).Select(cfps => cfps != "-" ? float.Parse(cfps) : 0f).ToArray(); i += frames-1; break;
                        case "Polygons": Polys = s.Skip(i + 2).Take(frames).Select(polys => polys != "-" ? float.Parse(polys) : 0f).ToArray(); i += frames-1; break;
                        case "Ping": Polys = s.Skip(i + 2).Take(frames).Select(ping => ping != "-" ? float.Parse(ping) : 0f).ToArray(); i += frames-1; break;
                    }
                }
            }
Esempio n. 10
0
        public override void Init(Core coordinator)
        {
            mTickListener = new Action(Core_Tick);
            base.Init(coordinator);

            mConfig = ExperimentalConfig.Instance;
            /*
            if (Core.HasPlugin<AvatarMovementPlugin>()) {
                mMovementPlugin = Core.GetPlugin<AvatarMovementPlugin>();
                mConfig = mMovementPlugin.Config as ExperimentalConfig;
            } else
                mConfig = new ExperimentalConfig();
            */

            LoggedInChanged += new Action<bool>(RecorderPlugin_LoggedInChanged);
        }
Esempio n. 11
0
        public static string CombineStats(ExperimentalConfig config, ServerStats server, ClientStats client, int count)
        {
            DateTime ts = server.TimeStamp;
            string line = client.TimeStamp.ToString(config.TimestampFormat) + ",";
            line += (config.Timestamp - ts).TotalMilliseconds + ",";
            line += count + ",";

            foreach (var key in config.OutputKeys) {
                switch (key.ToUpper()) {
                    case "CFPS": line += client.CFPS.Aggregate("", (s, v) => s + v + ",", f => f); break;
                    case "POLYGONS": line += client.Polys.Aggregate("", (s, v) => s + v + ",", f => f); break;
                    case "PING": line += client.Ping.Aggregate("", (s, v) => s + v + ",", f => f); break;
                    case "FT": line += server.FrameTime.ToString() + ","; break;
                    case "SFPS": line += server.SFPS.ToString() + ","; break;
                }
            }

            return line + "," + ((server.TimeStamp - client.TimeStamp).TotalMilliseconds);
        }