def buildFlotTitle(category, title, timelineStats, uid): """ Builds markup to render title for txn visualizations :param category: Category of transactions visualized by this flot :param title: Text title for this visualization :param timelineStats: Timeline stats with delta series to be plotted :param uid: Unique identifier to generate css selector id """ constituentNames = [ '{} -> {}'.format(deltaSeries.beginProbeName, deltaSeries.endProbeName) for deltaSeries in timelineStats.getTscDeltaSeriesCollection() ] title = '{} {} charts {}'.format( category, title, ' for constituent - ' if constituentNames else '') element = HTML().div(klass=TIME_POINT_STATS_TITLE) element.h3(title, style='display: inline') if constituentNames: elementId = '{}ConstituentSelector'.format(uid) constituentSelector = element.select(id=elementId, klass=SELECTOR) for i, constituentName in enumerate(constituentNames): if i == len(constituentNames) - 1: constituentSelector.option(constituentName, selected='selected') else: constituentSelector.option(constituentName) return element
def buildReport(self, app, resultOrder, classifier, events, probes, txnFilter, benchmarkPaths): """Builds a html report from contents of a profile info module""" from xpedite.report.codeFormatter import CodeFormatter highlightWrapBegin = '<div class="wy-nav-content">' highlightWrapEnd = '</div>' description = """ <div>This report provides an overview of profile info parameters used in recording this profile.</div> <div>The report below comprises, the list of probes, performance counters, classifiers, and other attributes that control transaction generation.</div> """ report = HTML() report += description appInfoList = [ 'App Name = {}'.format(app.name), 'App Host = {}'.format(app.ip), 'App Info = {}'.format(app.appInfoPath), 'xpedite Run = {}'.format(app.runId), ] if resultOrder: appInfoList.append('Result Order = {}'.format(resultOrder)) report += formatList(appInfoList) report.h3('Probes') report += self.buildProbeTable(probes) if benchmarkPaths: report.h3('Benchmarks') report += formatList(benchmarkPaths) if events: report.h3('Performance Counters') report += self.buildPmcTable(events) if txnFilter: report.h3('Transaction Filter') report += CodeFormatter().format(txnFilter, 'highlight', highlightWrapBegin, highlightWrapEnd) if classifier: report.h3('Transaction Classifier') report += CodeFormatter().format(classifier, 'highlight', highlightWrapBegin, highlightWrapEnd) return report
def buildStatsTitle(category, benchmarkNames, transactionCount): """ Builds title markup for the stats table :param category: Category of transactions in this profile :param transactionCount: Number of transactions :param benchmarkNames: Names of given benchmarks """ title = '{} latency statistics ({} transactions) {}'.format( category, transactionCount, ' vs benchmark - ' if benchmarkNames else '') element = HTML().div(klass=TIME_POINT_STATS_TITLE) element.h3(title, style='display: inline') if benchmarkNames: bechmarkSelector = element.select( onchange='onSelectBenchmark(this)', klass=SELECTOR) for benchmarkName in benchmarkNames: bechmarkSelector.option(benchmarkName) return element