Exemple #1
0
        public void Sort(Comparison <ABDetailRecord> comparison)
        {
            listRecords.Sort(comparison);
            ABDetailRecord last = null;

            foreach (var l in listRecords)
            {
                if (l.recordType == ABDetailRecord.RecordType.Get)
                {
                    getCount++;
                }
                else if (l.recordType == ABDetailRecord.RecordType.ContainsKey)
                {
                    containCount++;
                }
                else if (l.recordType == ABDetailRecord.RecordType.Add)
                {
                    //                  if (loadTime == TimeSpan.Zero)
                    //                  {
                    //                      loadTime = l.time - last.time;
                    //                  }
                    //                  else
                    //                  {
                    //                      loadTime = new TimeSpan((loadTime.Ticks + (l.time - last.time).Ticks) / 2);
                    //                  }
                    //                  if(firstbeginLoadTime == DateTime.MinValue)
                    //                  {
                    //                      firstbeginLoadTime = last.time;
                    //                  }
                    if (!ABLoadTime.ContainsKey(nameKey))
                    {
                        ABLoadTime.Add(nameKey, new List <TimeSpan>());
                    }

                    {
                        ABLoadTime[nameKey].Add((l.time - last.time));
                    }
                    if (!ABFirstbeginTime.ContainsKey(nameKey))
                    {
                        ABFirstbeginTime.Add(nameKey, firstbeginLoadTime);
                    }
                }
                last = l;
            }
        }
Exemple #2
0
    public static void InputAllXml()
    {
        var abpi         = BuildBundleManager.GetABSH().GetABUsesABPI();
        var abpi_Outdate = BuildBundleManager.GetABSH().GetABUses_OutdateABPI();

        if (!Directory.Exists(abpi.Dir_Relative))
        {
            Debug.Log(abpi.Dir_Relative + "文件夹不存在");
            return;
        }
        Dictionary <string, List <ABDetailRecord> > tmpRecords = new Dictionary <string, List <ABDetailRecord> >();
        var files = Directory.GetFiles(abpi.Dir_Relative);

        if (files == null || files.Length == 0)
        {
            Debug.Log(abpi.Dir_Relative + "文件夹里没有文件,无法分析");
            return;
        }
        if (!Directory.Exists(abpi_Outdate.Dir_Relative))
        {
            Directory.CreateDirectory(abpi_Outdate.Dir_Relative);
        }
        foreach (var f in files.Where(f => f.EndsWith(abpi.ExtName)))
        {
            List <ABDetailRecord> l = new List <ABDetailRecord>();
            tmpRecords.Add(f, l);
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(f);
            XmlNodeList nodeList = xmlDoc.SelectSingleNode(AssetBundleSettingHelper.xmlNode_Title).ChildNodes;
            foreach (XmlElement node in nodeList)
            {
                var abr = new ABDetailRecord();
                abr.InputXmlNode(node);
                tmpRecords[f].Add(abr);
            }
            //File.Move(f, Path.Combine(xmlDir_OutDate_Name, f.Substring(f.LastIndexOf(xmlDir_Name) + xmlDir_Name.Length + 1)));
        }
        Analysis(tmpRecords);
    }
Exemple #3
0
 public void Add(ABDetailRecord add)
 {
     listRecords.Add(add);
 }