示例#1
0
//line footer.qtpl:1
func StreamFooter(qw422016 *qt422016.Writer) {
	//line footer.qtpl:1
	qw422016.N().S(`
<div class="footer">copyright 2016</div>
`)
//line footer.qtpl:3
}
示例#2
0
//line report/report.qtpl:222
func (p *Page) streambytesSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:222
	qw422016.N().S(`[{name: 'BytesWritten',data: [`)
	//line report/report.qtpl:225
	qw422016.N().S(float64SliceToString(rate(p.BytesWritten, p.Interval)))
	//line report/report.qtpl:225
	qw422016.N().S(`]},{name: 'BytesRead',data: [`)
	//line report/report.qtpl:228
	qw422016.N().S(float64SliceToString(rate(p.BytesRead, p.Interval)))
	//line report/report.qtpl:228
	qw422016.N().S(`]}]`)
//line report/report.qtpl:230
}
示例#3
0
//line report/report.qtpl:34
func (p *Page) StreamUpdateRequestDuration(qw422016 *qt422016.Writer, d map[float64]float64) {
	//line report/report.qtpl:34
	qw422016.N().S(`
	`)
	//line report/report.qtpl:36
	for k, v := range d {
		if _, ok := p.RequestDuration[k]; !ok {
			p.RequestDuration[k] = make([]float64, 0)
		}

		p.RequestDuration[k] = append(p.RequestDuration[k], v)
	}

	//line report/report.qtpl:43
	qw422016.N().S(`
`)
//line report/report.qtpl:44
}
示例#4
0
//line report/report.qtpl:189
func (p *Page) streamerrorSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:189
	qw422016.N().S(`
	[{
		name: 'Errors',
		data: [`)
	//line report/report.qtpl:192
	qw422016.N().S(float64SliceToString(rate(p.Errors, p.Interval)))
	//line report/report.qtpl:192
	qw422016.N().S(`]
	},{
		name: 'Timeouts',
		data: [`)
	//line report/report.qtpl:195
	qw422016.N().S(float64SliceToString(rate(p.Timeouts, p.Interval)))
	//line report/report.qtpl:195
	qw422016.N().S(`]
	}]
`)
//line report/report.qtpl:197
}
示例#5
0
//line report/report.qtpl:178
func (p *Page) streamqpsSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:178
	qw422016.N().S(`
	[{
		name: 'Load average',
		data: [`)
	//line report/report.qtpl:181
	qw422016.N().S(uint64SliceToString(p.Qps))
	//line report/report.qtpl:181
	qw422016.N().S(`]
	},
	{
		name: 'Req-per-second',
		data: [`)
	//line report/report.qtpl:185
	qw422016.N().S(float64SliceToString(rate(p.RequestSum, p.Interval)))
	//line report/report.qtpl:185
	qw422016.N().S(`]
	}]
`)
//line report/report.qtpl:187
}
示例#6
0
//line header.qtpl:1
func StreamHeader(qw422016 *qt422016.Writer, title string) {
	//line header.qtpl:1
	qw422016.N().S(`
<title>`)
	//line header.qtpl:2
	qw422016.E().S(title)
	//line header.qtpl:2
	qw422016.N().S(`'s Home Page</title>
<div class="header">Page Header</div>
`)
//line header.qtpl:4
}
示例#7
0
//line report/report.qtpl:171
func (p *Page) streamconnectionSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:171
	qw422016.N().S(`
	[{
		name: 'Connections',
		data: [`)
	//line report/report.qtpl:174
	qw422016.N().S(uint64SliceToString(p.Connections))
	//line report/report.qtpl:174
	qw422016.N().S(`]
	}]
`)
//line report/report.qtpl:176
}
示例#8
0
//line index.qtpl:2
func StreamIndex(qw422016 *qt422016.Writer, u *model.User, nav []*model.Navigation, title string) {
	//line index.qtpl:2
	qw422016.N().S(`
<!DOCTYPE html>
<html>
<body>

<header>
`)
	//line index.qtpl:8
	StreamHeader(qw422016, title)
	//line index.qtpl:8
	qw422016.N().S(`
</header>

<nav>
`)
	//line index.qtpl:12
	StreamNavigation(qw422016, nav)
	//line index.qtpl:12
	qw422016.N().S(`
</nav>

<section>
<div class="content">
	<div class="welcome">
		<h4>Hello `)
	//line index.qtpl:18
	qw422016.E().S(u.FirstName)
	//line index.qtpl:18
	qw422016.N().S(`</h4>
		
		<div class="raw">`)
	//line index.qtpl:20
	qw422016.N().S(u.RawContent)
	//line index.qtpl:20
	qw422016.N().S(`</div>
		<div class="enc">`)
	//line index.qtpl:21
	qw422016.E().S(u.EscapedContent)
	//line index.qtpl:21
	qw422016.N().S(`</div>
	</div>

`)
	//line index.qtpl:24
	for i := 1; i <= 5; i++ {
		//line index.qtpl:24
		qw422016.N().S(`
		`)
		//line index.qtpl:25
		if i == 1 {
			//line index.qtpl:25
			qw422016.N().S(`
			<p>`)
			//line index.qtpl:26
			qw422016.E().S(u.FirstName)
			//line index.qtpl:26
			qw422016.N().S(` has `)
			//line index.qtpl:26
			qw422016.N().D(i)
			//line index.qtpl:26
			qw422016.N().S(` message</p>
		`)
			//line index.qtpl:27
		} else {
			//line index.qtpl:27
			qw422016.N().S(`
			<p>`)
			//line index.qtpl:28
			qw422016.E().S(u.FirstName)
			//line index.qtpl:28
			qw422016.N().S(` has `)
			//line index.qtpl:28
			qw422016.N().D(i)
			//line index.qtpl:28
			qw422016.N().S(` messages</p>
		`)
			//line index.qtpl:29
		}
		//line index.qtpl:29
		qw422016.N().S(`
`)
		//line index.qtpl:30
	}
	//line index.qtpl:30
	qw422016.N().S(`
</div>
</section>

<footer>
`)
	//line index.qtpl:35
	StreamFooter(qw422016)
	//line index.qtpl:35
	qw422016.N().S(`
</footer>

</body>
</html>
`)
//line index.qtpl:40
}
示例#9
0
//line simple.qtpl:2
func StreamSimpleQtc(qw422016 *qt422016.Writer, u *model.User) {
	//line simple.qtpl:2
	qw422016.N().S(`
<html>
    <body>
        <h1>`)
	//line simple.qtpl:5
	qw422016.E().S(u.FirstName)
	//line simple.qtpl:5
	qw422016.N().S(`</h1>

        <p>Here's a list of your favorite colors:</p>
        <ul>
        `)
	//line simple.qtpl:9
	for _, colorName := range u.FavoriteColors {
		//line simple.qtpl:9
		qw422016.N().S(`
            <li>`)
		//line simple.qtpl:10
		qw422016.E().S(colorName)
		//line simple.qtpl:10
		qw422016.N().S(`</li>
        `)
		//line simple.qtpl:11
	}
	//line simple.qtpl:11
	qw422016.N().S(`
        </ul>
    </body>
</html>
`)
//line simple.qtpl:15
}
示例#10
0
//line report/report.qtpl:46
func StreamPrintPage(qw422016 *qt422016.Writer, p *Page) {
	//line report/report.qtpl:46
	qw422016.N().S(`
<html>
	<head>
		<title>`)
	//line report/report.qtpl:49
	p.streamtitle(qw422016)
	//line report/report.qtpl:49
	qw422016.N().S(`</title>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
		<script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script>
		<script type="text/javascript" src="https://code.highcharts.com/modules/exporting.js"></script>
		<script type="text/javascript">`)
	//line report/report.qtpl:53
	qw422016.N().Z(MustAsset("report/static/js/utils.js"))
	//line report/report.qtpl:53
	qw422016.N().S(`</script>
		<style>`)
	//line report/report.qtpl:54
	qw422016.N().Z(MustAsset("report/static/css/main.css"))
	//line report/report.qtpl:54
	qw422016.N().S(`</style>
	</head>
	 <body>
		`)
	//line report/report.qtpl:57
	p.streamsimpleChart(qw422016, "connections", p.connectionSeries)
	//line report/report.qtpl:57
	qw422016.N().S(`
		`)
	//line report/report.qtpl:58
	p.streamsimpleChart(qw422016, "qps", p.qpsSeries)
	//line report/report.qtpl:58
	qw422016.N().S(`
		`)
	//line report/report.qtpl:59
	p.streamsimpleChart(qw422016, "errors-vs-timeouts", p.errorSeries)
	//line report/report.qtpl:59
	qw422016.N().S(`
		`)
	//line report/report.qtpl:60
	p.streamsimpleChart(qw422016, "latency", p.durationSeries)
	//line report/report.qtpl:60
	qw422016.N().S(`
		`)
	//line report/report.qtpl:61
	p.streambytesChart(qw422016, "written-vs-read", p.bytesSeries)
	//line report/report.qtpl:61
	qw422016.N().S(`
		`)
	//line report/report.qtpl:62
	p.streampieChart(qw422016, "status-codes", p.statusCodesSeries)
	//line report/report.qtpl:62
	qw422016.N().S(`
		`)
	//line report/report.qtpl:63
	p.streamerrorMessagesTable(qw422016)
	//line report/report.qtpl:63
	qw422016.N().S(`
	</body>
</html>
`)
//line report/report.qtpl:66
}
示例#11
0
//line report/report.qtpl:250
func (p *Page) streamerrorMessagesTable(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:250
	qw422016.N().S(`
	<div style = "float: left; width:50%; height: 400px;">
	 <!-- IE < 10 does not like giving a tbody a height.  The workaround here applies the scrolling to a wrapped <div>. -->
	 <!--[if lte IE 9]>
	 <div class="old_ie_wrapper">
	 <!--<![endif]-->
	 <p class = "title">Error distribution</p>
	 <table class="fixed_headers">
		 <thead>
			<tr>
				<td>Count</td>
				<td>Message</td>
			</tr>
		 </thead>
		 <tbody>
			`)
	//line report/report.qtpl:265
	for k, v := range p.ErrorMessages {
		//line report/report.qtpl:265
		qw422016.N().S(`
				<tr>
					<td>`)
		//line report/report.qtpl:267
		qw422016.N().D(v)
		//line report/report.qtpl:267
		qw422016.N().S(`</td>
					<td>`)
		//line report/report.qtpl:268
		qw422016.N().S(k)
		//line report/report.qtpl:268
		qw422016.N().S(`</td>
				</tr>
			`)
		//line report/report.qtpl:270
	}
	//line report/report.qtpl:270
	qw422016.N().S(`
			`)
	//line report/report.qtpl:271
	if len(p.ErrorMessages) == 0 {
		//line report/report.qtpl:271
		qw422016.N().S(`
			<tr>
				<td></td>
				<td>No error messages</td>
			</tr>
            `)
		//line report/report.qtpl:276
	}
	//line report/report.qtpl:276
	qw422016.N().S(`
		 </tbody>
	 </table>
	 <!--[if lte IE 9]>
     </div>
     <!--<![endif]-->
     </div>
`)
//line report/report.qtpl:283
}
示例#12
0
//line report/report.qtpl:234
func (p *Page) streamstatusCodesSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:234
	qw422016.N().S(`[{name: 'Status codes',colorByPoint: true,data: [`)
	//line report/report.qtpl:239
	for k, v := range p.StatusCodes {
		//line report/report.qtpl:239
		qw422016.N().S(`{name: '`)
		//line report/report.qtpl:241
		qw422016.N().S(k)
		//line report/report.qtpl:241
		qw422016.N().S(`',y:`)
		//line report/report.qtpl:242
		qw422016.N().FPrec(v, 2)
		//line report/report.qtpl:242
		qw422016.N().S(`},`)
		//line report/report.qtpl:244
	}
	//line report/report.qtpl:244
	qw422016.N().S(`]}]`)
//line report/report.qtpl:247
}
示例#13
0
//line report/report.qtpl:68
func (p *Page) streamsimpleChart(qw422016 *qt422016.Writer, title string, fn seriesFunc) {
	//line report/report.qtpl:68
	qw422016.N().S(`
	<script>
	$(function () {
    			$('#`)
	//line report/report.qtpl:71
	qw422016.N().S(title)
	//line report/report.qtpl:71
	qw422016.N().S(`').highcharts({
					title: {
						text: '`)
	//line report/report.qtpl:73
	qw422016.N().S(strings.Title(title))
	//line report/report.qtpl:73
	qw422016.N().S(`',
						x: -20 //center
					},
					xAxis: {
						type: 'linear',
					},
					legend: {
						layout: 'vertical',
						align: 'right',
						verticalAlign: 'middle',
						borderWidth: 0
					},
					plotOptions: {
						series: {
							pointStart: 0,
							pointInterval: `)
	//line report/report.qtpl:88
	qw422016.N().FPrec(p.Interval, 2)
	//line report/report.qtpl:88
	qw422016.N().S(`,
						}
					},
					series: `)
	//line report/report.qtpl:91
	qw422016.N().S(fn())
	//line report/report.qtpl:91
	qw422016.N().S(`
				});
    		});
    </script>
   	<div id="`)
	//line report/report.qtpl:95
	qw422016.N().S(title)
	//line report/report.qtpl:95
	qw422016.N().S(`" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
`)
//line report/report.qtpl:96
}
示例#14
0
//line report/report.qtpl:200
func (p *Page) streamdurationSeries(qw422016 *qt422016.Writer) {
	//line report/report.qtpl:200
	qw422016.N().S(`[`)
	//line report/report.qtpl:203
	var keys []float64
	for k := range p.RequestDuration {
		keys = append(keys, k)
	}
	sort.Float64s(keys)

	//line report/report.qtpl:209
	for i, k := range keys {
		//line report/report.qtpl:209
		qw422016.N().S(`{name: '`)
		//line report/report.qtpl:211
		qw422016.N().F(k)
		//line report/report.qtpl:211
		qw422016.N().S(`',data: [`)
		//line report/report.qtpl:212
		qw422016.N().S(float64SliceToString(p.RequestDuration[k]))
		//line report/report.qtpl:212
		qw422016.N().S(`],tooltip: {valueSuffix: ' s'}}`)
		//line report/report.qtpl:215
		if i+1 < len(keys) {
			//line report/report.qtpl:215
			qw422016.N().S(`,`)
			//line report/report.qtpl:215
		}
		//line report/report.qtpl:216
	}
	//line report/report.qtpl:216
	qw422016.N().S(`]`)
//line report/report.qtpl:218
}
//line navigation.qtpl:2
func StreamNavigation(qw422016 *qt422016.Writer, nav []*model.Navigation) {
	//line navigation.qtpl:2
	qw422016.N().S(`
<ul class="navigation">
`)
	//line navigation.qtpl:4
	for _, item := range nav {
		//line navigation.qtpl:4
		qw422016.N().S(`
	<li><a href="`)
		//line navigation.qtpl:5
		qw422016.E().S(item.Link)
		//line navigation.qtpl:5
		qw422016.N().S(`">`)
		//line navigation.qtpl:5
		qw422016.E().S(item.Item)
		//line navigation.qtpl:5
		qw422016.N().S(`</a></li>
`)
		//line navigation.qtpl:6
	}
	//line navigation.qtpl:6
	qw422016.N().S(`
</ul>
`)
//line navigation.qtpl:8
}
示例#16
0
//line report/report.qtpl:32
func (p *Page) streamtitle(qw422016 *qt422016.Writer) {
//line report/report.qtpl:32
qw422016.E().S(p.Title) }
示例#17
0
//line report/report.qtpl:138
func (p *Page) streampieChart(qw422016 *qt422016.Writer, title string, fn seriesFunc) {
	//line report/report.qtpl:138
	qw422016.N().S(`
	<script>
	$(function () {
    			$('#`)
	//line report/report.qtpl:141
	qw422016.N().S(title)
	//line report/report.qtpl:141
	qw422016.N().S(`').highcharts({
					chart: {
						plotBackgroundColor: null,
						plotBorderWidth: null,
						plotShadow: false,
						type: 'pie'
					},
					title: {
						text: '`)
	//line report/report.qtpl:149
	qw422016.N().S(strings.Title(title))
	//line report/report.qtpl:149
	qw422016.N().S(`',
					},
					 tooltip: {
						pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
					},
					plotOptions: {
						pie: {
							allowPointSelect: true,
							cursor: 'pointer',
							dataLabels: {
								enabled: false
							},
							showInLegend: true
						}
					},
					series: `)
	//line report/report.qtpl:164
	qw422016.N().S(fn())
	//line report/report.qtpl:164
	qw422016.N().S(`
				});
    		});
    </script>
   	<div id="`)
	//line report/report.qtpl:168
	qw422016.N().S(title)
	//line report/report.qtpl:168
	qw422016.N().S(`" style = "float: left; width:50%; height: 400px;"></div>
`)
//line report/report.qtpl:169
}
示例#18
0
//line report/report.qtpl:98
func (p *Page) streambytesChart(qw422016 *qt422016.Writer, title string, fn seriesFunc) {
	//line report/report.qtpl:98
	qw422016.N().S(`
	<script>
	$(function () {
    			$('#`)
	//line report/report.qtpl:101
	qw422016.N().S(title)
	//line report/report.qtpl:101
	qw422016.N().S(`').highcharts({
					title: {
						text: '`)
	//line report/report.qtpl:103
	qw422016.N().S(strings.Title(title))
	//line report/report.qtpl:103
	qw422016.N().S(`',
						x: -20 //center
					},
					xAxis: {
						type: 'linear',
					},
					yAxis: {
						labels: {
							formatter: function() { return bytes(this.value, true); }
						},
						min: 0,
					},
					tooltip: {
						enabled: true,
						formatter: function() { return bytes(this.y, true);}
					},
					legend: {
						layout: 'vertical',
						align: 'right',
						verticalAlign: 'middle',
						borderWidth: 0
					},
					plotOptions: {
						series: {
							pointStart: 0,
							pointInterval: `)
	//line report/report.qtpl:128
	qw422016.N().FPrec(p.Interval, 2)
	//line report/report.qtpl:128
	qw422016.N().S(`,
						}
					},
					series: `)
	//line report/report.qtpl:131
	qw422016.N().S(fn())
	//line report/report.qtpl:131
	qw422016.N().S(`
				});
    		});
    </script>
   	<div id="`)
	//line report/report.qtpl:135
	qw422016.N().S(title)
	//line report/report.qtpl:135
	qw422016.N().S(`" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
`)
//line report/report.qtpl:136
}