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 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