Example #1
0
 def index(self):
   h = HTML()
   h.h1("Hello world")
   h.h2("And")
   h.h3("Bye")
   indexString= str(h)
   return indexString
Example #2
0
    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
Example #3
0
 def buildDiffTitle(lhs, rhs):
     """
 Builds a title for the transaction diff table
 """
     from xpedite.report.markup import TIME_POINT_STATS_TITLE
     title = 'Transaction diff\ntxn #{} vs txn #{}'.format(lhs, rhs)
     element = HTML().div(klass=TIME_POINT_STATS_TITLE)
     element.h3(title)
     return element
Example #4
0
 def html(self, n=None):
     html = HTML()
     if n: html.h3('Node #' + str(n))
     if self.host:
         html.b(self.host)
         html.b('(' + self.ip + ')')
     else:
         html.b(self.ip)
     p = html.p('')
     if self.city: p += self.city + ', '
     if self.regionName: p += self.regionName + ', '
     elif self.region: p += self.region + ', '
     if self.country: p += self.country
     html.p
     html.a(WHOIS_URL + self.ip)
     return html
Example #5
0
 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
Example #6
0
    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
Example #7
0
		fp_samples.append(fp_new)
		tn_samples.append(tn_new)
		fn_samples.append(fn_new)

	return (tp_samples, fp_samples, tn_samples, fn_samples)

th_list = read_th_nums(th_list)
feature_importances = read_feature_importance(num_of_iters, feature_importances)
feature_names = read_feature_names(feature_names)
tp_samples, fp_samples, tn_samples, fn_samples = read_samples(num_of_iters, tp_samples, fp_samples, tn_samples, fn_samples, th_list)
recal, precision, f1_score = read_stats(num_of_iters, recal, precision, f1_score)

h.h1('While training on the problems 0-200', color = ('rgb(205, 12, 24)'))
for i in range(0, num_of_iters, 2):
	h.h2('considering iteration number ' + str(i))
	h.h3("Feature importances are:")
	table_data = []
	table_line = []
	table_line.append("feature_name")
	table_line.append("importance")
	table_data.append(table_line)
	h.p("feature_name \t\t\t importance")
	for j in range(0, len(feature_names)):
		table_line = []
		table_line.append(feature_names[j])
		table_line.append(feature_importances[i][j])
		table_data.append(table_line)
		h.p(feature_names[j] + '\t\t\t ' + feature_importances[i][j])

	h.h3("TP samples are")
	for k in range(0, len(th_list)):