Ejemplo n.º 1
0
        public static List <Records> Read(string filename)
        {
            TextReader inReader = new StreamReader(File.Open(filename, FileMode.Open));

            if (inReader == null)
            {
                Logger.Log("{0} Read: Failed opening stat file '{1}'", LogHeader, filename);
                return(null);
            }

            List <Records> records = new List <Records>();
            string         inLine;

            using (inReader)
            {
                while ((inLine = inReader.ReadLine()) != null)
                {
                    // Cheap way of checking for the optional title line
                    if (inLine.Contains(",Category,"))
                    {
                        continue;
                    }

                    try
                    {
                        string[]         pieces = inLine.Split(',');
                        StatServerRecord aRec   = new StatServerRecord();
                        aRec.time                    = LongDate.ParseLongDate(pieces[0]);
                        aRec.bucket                  = 0;
                        aRec.category                = pieces[1];
                        aRec.regionName              = pieces[2];
                        aRec.cPUPercent              = Parser.GetFloat(pieces[3]);
                        aRec.totalProcessorTime      = Parser.GetFloat(pieces[4]);
                        aRec.userProcessorTime       = Parser.GetFloat(pieces[5]);
                        aRec.privilegedProcessorTime = Parser.GetFloat(pieces[6]);
                        aRec.threads                 = Parser.GetInt(pieces[7]);
                        aRec.averageMemoryChurn      = Parser.GetFloat(pieces[8]);
                        aRec.lastMemoryChurn         = Parser.GetFloat(pieces[9]);
                        aRec.objectMemory            = Parser.GetFloat(pieces[10]);
                        aRec.processMemory           = Parser.GetFloat(pieces[11]);
                        aRec.bytesRcvd               = Parser.GetDouble(pieces[12]);
                        aRec.bytesSent               = Parser.GetDouble(pieces[13]);
                        aRec.totalBytes              = Parser.GetDouble(pieces[14]);

                        records.Add(aRec);
                    }
                    catch (Exception e)
                    {
                        Logger.Log("{0} Exception parsing line: '{1}'", LogHeader, inLine);
                        Logger.Log("{0} Exception parsing line: e: {1}", LogHeader, e);
                    }
                }
            }
            return(records);
        }
Ejemplo n.º 2
0
        public static List <Records> Read(string filename)
        {
            TextReader inReader = new StreamReader(File.Open(filename, FileMode.Open));

            if (inReader == null)
            {
                Logger.Log("{0} Read: Failed opening stat file '{1}'", LogHeader, filename);
                return(null);
            }

            List <Records> records = new List <Records>();
            string         inLine;

            using (inReader)
            {
                while ((inLine = inReader.ReadLine()) != null)
                {
                    // Cheap way of checking for the optional title line
                    if (inLine.Contains(",Category,"))
                    {
                        continue;
                    }

                    try
                    {
                        string[]        pieces = inLine.Split(',');
                        StatSceneRecord aRec   = new StatSceneRecord();
                        aRec.time          = LongDate.ParseLongDate(pieces[0]);
                        aRec.bucket        = 0;
                        aRec.category      = pieces[1];
                        aRec.container     = pieces[2];
                        aRec.rootAgents    = Parser.GetInt(pieces[3]);
                        aRec.childAgents   = Parser.GetInt(pieces[4]);
                        aRec.simFPS        = Parser.GetFloat(pieces[5]);
                        aRec.physicsFPS    = Parser.GetFloat(pieces[6]);
                        aRec.totalPrims    = Parser.GetInt(pieces[7]);
                        aRec.activePrims   = Parser.GetInt(pieces[8]);
                        aRec.activeScripts = Parser.GetInt(pieces[9]);
                        aRec.scriptLines   = (int)Parser.GetFloat(pieces[10]); // somtimes is recorded as a fraction
                        aRec.frameTime     = Parser.GetFloat(pieces[11]);
                        aRec.physicsTime   = Parser.GetFloat(pieces[12]);
                        aRec.agentTime     = Parser.GetFloat(pieces[13]);
                        aRec.imageTime     = Parser.GetFloat(pieces[14]);
                        aRec.netTime       = Parser.GetFloat(pieces[15]);
                        aRec.otherTime     = Parser.GetFloat(pieces[16]);
                        aRec.simSpareMS    = Parser.GetFloat(pieces[17]);
                        aRec.agentUpdates  = Parser.GetFloat(pieces[18]);
                        aRec.slowFrames    = Parser.GetInt(pieces[19]);
                        aRec.timeDilation  = Parser.GetFloat(pieces[20]);

                        records.Add(aRec);
                    }
                    catch (Exception e)
                    {
                        Logger.Log("{0} Exception parsing line: '{1}'", LogHeader, inLine);
                        Logger.Log("{0} Exception parsing line: e: {1} ", LogHeader, e);
                    }
                }
            }
            return(records);
        }
Ejemplo n.º 3
0
        public static List <Records> Read(string filename)
        {
            TextReader inReader = new StreamReader(File.Open(filename, FileMode.Open));

            if (inReader == null)
            {
                Logger.Log("{0} Read: Failed opening stat file '{1}'", LogHeader, filename);
                return(null);
            }

            List <Records> records = new List <Records>();
            string         inLine;

            using (inReader)
            {
                while ((inLine = inReader.ReadLine()) != null)
                {
                    // Cheap way of checking for the optional title line
                    if (inLine.Contains("SyncConnNum"))
                    {
                        continue;
                    }

                    try
                    {
                        string[] pieces = inLine.Split(',');
                        StatSyncConnectorRecord aRec = new StatSyncConnectorRecord();
                        aRec.time                   = LongDate.ParseLongDate(pieces[0]);
                        aRec.bucket                 = 0;
                        aRec.region                 = pieces[1];
                        aRec.connectorNum           = Parser.GetInt(pieces[2]);
                        aRec.actorID                = pieces[3];
                        aRec.otherSideActorID       = pieces[4];
                        aRec.otherSideRegionName    = pieces[5];
                        aRec.msgs_sent              = Parser.GetInt(pieces[6]);
                        aRec.msgs_rcvd              = Parser.GetInt(pieces[7]);
                        aRec.bytes_sent             = Parser.GetLong(pieces[8]);
                        aRec.bytes_rcvd             = Parser.GetLong(pieces[9]);
                        aRec.msgs_sent_per_sec      = Parser.GetFloat(pieces[10]);
                        aRec.msgs_rcvd_per_sec      = Parser.GetFloat(pieces[11]);
                        aRec.bytes_sent_per_sec     = Parser.GetFloat(pieces[12]);
                        aRec.bytes_rcvd_per_sec     = Parser.GetFloat(pieces[13]);
                        aRec.queued_msgs            = Parser.GetInt(pieces[14]);
                        aRec.updatedProperties_sent = Parser.GetInt(pieces[15]);
                        aRec.updatedProperties_rcvd = Parser.GetInt(pieces[16]);
                        aRec.newObject_sent         = Parser.GetInt(pieces[17]);
                        aRec.newObject_rcvd         = Parser.GetInt(pieces[18]);
                        aRec.newPresence_sent       = Parser.GetInt(pieces[19]);
                        aRec.newPresence_rcvd       = Parser.GetInt(pieces[20]);

                        records.Add(aRec);
                    }
                    catch (Exception e)
                    {
                        Logger.Log("{0} Exception parsing line: '{1}'", LogHeader, inLine);
                        Logger.Log("{0} Exception parsing line: e: {1} ", LogHeader, e);
                    }
                }
            }
            return(records);
        }