def plot(routePoints=None, profiles=None): """ Creates visualization for a one or more conflated timeline(s) :param routePoints: Indices of the conflated route (Default value = None) :param profiles: Profiles with timelines to plot (Default value = None) """ if isinstance(routePoints, int): from xpedite.jupyter.plot import buildTxnPlot, buildPmcPlot from xpedite.analytics.timelineFilter import locateTimeline profiles = profiles if profiles else globalProfile() txnId = routePoints timeline = locateTimeline(profiles, txnId) if timeline: display(HTML(buildTxnPlot(timeline))) if profiles.pmcNames: display(HTML(buildPmcPlot(timeline))) return display(HTML(ERROR_TEXT.format('cannot find transaction for id {}'.format(txnId)))) return from xpedite.report.flot import FlotBuilder profile = conflate(profiles, routePoints) if profile: flot = FlotBuilder().buildBenchmarkFlot(profile.category, profile.current, profile.benchmarks) display(HTML(str(flot)))
def buildReport(self, timelineStats, benchmarkTlsMap, probes, category, resultOrder, threshold, logAbsoluteValues=False, logTimeline=False, logData=False): """ Builds latency constituent report with statistics, visualizations and timeline table :param timelineStats: Time line and duration series statistics :type timelineStats: xpedite.analytics.timeline.TimelineStats :param benchmarkTlsMap: Time line and duration series statistics for benchmarks :param probes: List of probes in route, taken by the transaction collection :param category: Category of the transactions in this profile :param resultOrder: Sort order for a collection of timelines :param threshold: Threshold for number of transactions rendered in html reports :param logAbsoluteValues: Flag to enable reporting of absolute tsc values :param logTimeline: Flag to enable reporting of timeline details :param logData: Flag to enable logging of data associated with transaction """ uid = makeUniqueId() tableContainer = self.buildTimelineTable(timelineStats, probes, resultOrder, threshold, uid, logAbsoluteValues, logTimeline, logData) timelineCollection = self.reorderTimelineRecords( timelineStats.timelineCollection, resultOrder) pmuScript = self.buildPmuScript(timelineCollection, uid) flotBuilder = FlotBuilder() flotMarkup = flotBuilder.buildBenchmarkFlot(category, timelineStats, benchmarkTlsMap) statsReport = StatsBuilder().buildStatsTable(category, timelineStats, benchmarkTlsMap) reportTitle = HTML().h3('{} Transaction Time lines'.format(category)) return (HTML_BEGIN + statsReport + flotMarkup + str(reportTitle) + pmuScript + str(tableContainer) + HTML_END)