def loadProbes(app): """ Builds a map of probe states from target application :param app: an instance of xpedite app, to interact with target application """ from xpedite.types.containers import ProbeMap probes = ProbeAdmin.getProbes(app) return ProbeMap(probes, probes).namedProbeMap.values()
def mapReportProbes(route, userProbes): """ Creates probes with human friendly name for reporting :param userProbes: List of probes enabled for a profiling session """ reportProbes = [] userProbeMap = ProbeMap(userProbes) for probe in route.probes: if probe in userProbeMap: reportProbes.append(userProbeMap[probe]) else: reportProbes.append(probe) return reportProbes
def buildIndex(counters): """ Builds an instance of probe map using fly weight pattern :param counters: A collection of counters """ route = Route((counter.probe for counter in counters)) index = ProbeIndexFactory.cache.get(route, None) if not index: probeMap = ProbeMap() for i, counter in enumerate(counters): ProbeIndexFactory._addCounterToMap(probeMap, counter, i) index = ProbeIndexFactory.Index(route, probeMap) ProbeIndexFactory.cache.update({route: index}) return index
def __init__(self, name, cpuInfo, probes, topdownMetrics, events): """ Constructs a abstract transaction loader :param name: Name of the profile being loaded :param probes: List of probes enabled for the profile session :param topdownMetrics: Top down metrics to be computed :param events: PMU events collected for the profile session """ self.name = name self.cpuInfo = cpuInfo self.probes = probes self.topdownMetrics = topdownMetrics self.events = events self.probeMap = ProbeMap(probes) self.reset() self.dataSources = [] self.currentTxn = None self.threadId = None self.tlsAddr = None