Ejemplo n.º 1
0
        private long CollectClassStats(FileUsageStats stats, ClassNode classNode)
        {
            long subClassSlotUsage = 0;

            for (IEnumerator curSubClassIter = classNode.SubClasses().GetEnumerator(); curSubClassIter
                 .MoveNext();)
            {
                ClassNode curSubClass = ((ClassNode)curSubClassIter.Current);
                subClassSlotUsage += CollectClassStats(stats, curSubClass);
            }
            ClassMetadata clazz           = classNode.ClassMetadata();
            long          classIndexUsage = 0;

            if (clazz.HasClassIndex())
            {
                classIndexUsage = BTreeUsage(((BTreeClassIndexStrategy)clazz.Index()).Btree());
            }
            long fieldIndexUsage = FieldIndexUsage(clazz);

            FileUsageStatsCollector.InstanceUsage instanceUsage = ClassSlotUsage(clazz);
            long            totalSlotUsage = instanceUsage.slotUsage;
            long            ownSlotUsage   = totalSlotUsage - subClassSlotUsage;
            ClassUsageStats classStats     = new ClassUsageStats(clazz.GetName(), ownSlotUsage, classIndexUsage
                                                                 , fieldIndexUsage, instanceUsage.miscUsage);

            stats.AddClassStats(classStats);
            return(totalSlotUsage);
        }
Ejemplo n.º 2
0
 internal virtual void AddClassStats(Db4objects.Db4o.Filestats.ClassUsageStats classStats
                                     )
 {
     _classUsageStats = ((TreeStringObject)Tree.Add(_classUsageStats, new TreeStringObject
                                                        (classStats.ClassName(), classStats)));
 }
Ejemplo n.º 3
0
 internal virtual void AddClassStats(ClassUsageStats classStats
     )
 {
     _classUsageStats = ((TreeStringObject) Tree.Add(_classUsageStats, new TreeStringObject
         (classStats.ClassName(), classStats)));
 }
Ejemplo n.º 4
0
		private long CollectClassStats(FileUsageStats stats, ClassNode classNode)
		{
			long subClassSlotUsage = 0;
			for (IEnumerator curSubClassIter = classNode.SubClasses().GetEnumerator(); curSubClassIter
				.MoveNext(); )
			{
				ClassNode curSubClass = ((ClassNode)curSubClassIter.Current);
				subClassSlotUsage += CollectClassStats(stats, curSubClass);
			}
			ClassMetadata clazz = classNode.ClassMetadata();
			long classIndexUsage = 0;
			if (clazz.HasClassIndex())
			{
				classIndexUsage = BTreeUsage(((BTreeClassIndexStrategy)clazz.Index()).Btree());
			}
			long fieldIndexUsage = FieldIndexUsage(clazz);
			FileUsageStatsCollector.InstanceUsage instanceUsage = ClassSlotUsage(clazz);
			long totalSlotUsage = instanceUsage.slotUsage;
			long ownSlotUsage = totalSlotUsage - subClassSlotUsage;
			ClassUsageStats classStats = new ClassUsageStats(clazz.GetName(), ownSlotUsage, classIndexUsage
				, fieldIndexUsage, instanceUsage.miscUsage);
			stats.AddClassStats(classStats);
			return totalSlotUsage;
		}