forked from btfak/sniper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
const.go
75 lines (70 loc) · 2.37 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
const (
sniperVersionInfo = `This is Sniper ,version 1.0
Copyright (C) 2013 by btfak.com, et al.
This is free software; open source on github.com/btfak/sniper.`
sniperUsageInfo = `Usage:
sniper [options] http[s]://hostname[:port][/path]
sniper [options] -f urls.txt
Options:
-c, --concurrent concurrent users, default is 1.
-n, --requests number of requests to perform.
-r, --repetitions number of times to run the test.
-t, --time testing time, 30 mean 30 seconds.
-R, --sniperc specify an sniperc file to get config
(default is $HOME/.sniperc).
-f, --urlfile select a specific URLS file.
-p, --post select a specific file to POST.
-T, --content-type set Content-Type in request
(default is text/plain).
-V, --Version print the version number.
-h, --help print this section.
-C, --config show the current config.
-s, --plot plot detail transactions' info
(true | false,default set true,
notice: set -t will not plot anyhow).
Copyright (C) 2013 by btfak.com, et al.
This is free software; open source on github.com/btfak/sniper.
`
sniperNoDataInfo = "file no data."
sniperOpenFileErrorInfo = "open file error."
)
var plotsTemplate = `<!doctype>
<html>
<head>
<title>Sniper Plots</title>
</head>
<body>
<div id="sniper" style="font-family: Courier; width: 100%%; height: 600px"></div>
<p>
<b>Display: </b>
<input type=checkbox id=0 onClick="stockchange(this)" checked>
<label for="trans"> transaction</label>
<input type=checkbox id=1 onClick="stockchange(this)" unchecked>
<label for="conn"> connection</label>
<input type=checkbox id=2 onClick="stockchange(this)" unchecked>
<label for="resp"> response</label>
</p>
<script>
%s
</script>
<script>
stockchart = new Dygraph(
document.getElementById("sniper"),
[%s],
{
title: 'Sniper Plot',
labels: ['Seconds', 'Transaction(ms)','Connection(ms)','Response(ms)'],
ylabel: 'Latency(ms)',
xlabel: 'Elapse time',
fillGraph: true,
visibility: [true, false, false,false],
logscale: true
}
);
function stockchange(el) {
stockchart.setVisibility(el.id, el.checked);
}
</script>
</body>
</html>`