1 11 package org.eclipse.core.runtime.internal.stats; 12 13 import java.util.ArrayList ; 14 15 19 20 public class BundleStats { 21 public String symbolicName; 22 public long id; 23 public int activationOrder; 24 private long timestamp; private boolean duringStartup; private long startupTime; private long startupMethodTime; 29 private long traceStart = -1; 31 private long traceEnd = -1; 32 33 private ArrayList bundlesActivated = new ArrayList (3); private BundleStats activatedBy = null; 36 37 public BundleStats(String name, long id) { 38 this.symbolicName = name; 39 this.id = id; 40 } 41 42 public long getTimestamp() { 43 return timestamp; 44 } 45 46 public int getActivationOrder() { 47 return activationOrder; 48 } 49 50 protected void activated(BundleStats info) { 51 bundlesActivated.add(info); 52 } 53 54 public BundleStats getActivatedBy() { 55 return activatedBy; 56 } 57 58 public long getId() { 59 return id; 60 } 61 62 public String getSymbolicName() { 63 return symbolicName; 64 } 65 66 public long getStartupTime() { 67 return startupTime; 68 } 69 70 public long getStartupMethodTime() { 71 return startupMethodTime; 72 } 73 74 public boolean isStartupBundle() { 75 return duringStartup; 76 } 77 78 public int getClassLoadCount() { 79 if (!StatsManager.MONITOR_CLASSES) 80 return 0; 81 ClassloaderStats loader = ClassloaderStats.getLoader(symbolicName); 82 return loader == null ? 0 : loader.getClassLoadCount(); 83 } 84 85 public long getClassLoadTime() { 86 if (!StatsManager.MONITOR_CLASSES) 87 return 0; 88 ClassloaderStats loader = ClassloaderStats.getLoader(symbolicName); 89 return loader == null ? 0 : loader.getClassLoadTime(); 90 } 91 92 public ArrayList getBundlesActivated() { 93 return bundlesActivated; 94 } 95 96 public long getTraceStart() { 97 return traceStart; 98 } 99 100 public long getTraceEnd() { 101 return traceEnd; 102 } 103 104 protected void setTimestamp(long value) { 105 timestamp = value; 106 } 107 108 protected void setActivationOrder(int value) { 109 activationOrder = value; 110 } 111 112 protected void setTraceStart(long time) { 113 traceStart = time; 114 } 115 116 protected void setDuringStartup(boolean value) { 117 duringStartup = value; 118 } 119 120 protected void endActivation() { 121 startupTime = System.currentTimeMillis() - timestamp; 122 } 123 124 protected void setTraceEnd(long position) { 125 traceEnd = position; 126 } 127 128 protected void setActivatedBy(BundleStats value) { 129 activatedBy = value; 130 } 131 } 132 | Popular Tags |