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