Skip to content

Commit 87c8167

Browse files
author
ladeak
committed
CHttpExtension with Bayesian P
1 parent a84d407 commit 87c8167

6 files changed

Lines changed: 36 additions & 5 deletions

File tree

src/CHttp/Performance/Statitics/DiffPrinter.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ private bool PrintBayeisanComparison(PerformanceMeasurementResults session0, Per
178178
{
179179
double? percent = StatisticsCalculator.CalculateBayesianProbability(session0, session1) * 100;
180180
if (percent.HasValue)
181-
_console.WriteLine($"With {percent:00.0}% probability, the base session's true mean latency is lower than compared session's.");
181+
{
182+
var relativePercent = percent.Value < 50 ? 100 - percent.Value : percent.Value;
183+
var direction = percent.Value < 50 ? "higher" : "lower";
184+
_console.WriteLine($"With {relativePercent:00.0}% probability, the base session's true mean latency is {direction} than compared session's.");
185+
}
182186
return true;
183187
}
184188

src/CHttpServer/TestCHttpServerApplication/api.chttp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@
44
GET https://{{host}}/ HTTP/2
55

66
###
7+
# @name direct0
78
# @clientsCount 10
89
# @requestCount 20000
910
# @shared-socketHandler true
1011
GET https://{{host}}/direct HTTP/2
1112

13+
###
14+
15+
###
16+
# @name direct1
17+
# @clientsCount 10
18+
# @requestCount 20000
19+
# @shared-socketHandler true
20+
GET https://{{host}}/direct HTTP/2
21+
22+
###
23+
DIFF direct0 direct1
1224
###
1325
GET https://{{host}} HTTP/3
1426

src/VSCodeExt/dist/extension.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.
4.5 KB
Binary file not shown.

src/VSCodeExt/syntaxes/http.tmLanguage.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"name": "comment.line.sharp.http"
154154
},
155155
{
156-
"match": "^\\s*\\/{2,}\\s+(?:((@)name)\\s+([^\\s\\.]+))$",
156+
"match": "^\\s*\\#{1,}\\s+(?:((@)clientsCount)\\s+([^\\s\\.]+))$",
157157
"captures": {
158158
"1": {
159159
"name": "entity.other.attribute-name"
@@ -165,8 +165,23 @@
165165
"name": "entity.name.type.http"
166166
}
167167
},
168-
"name": "comment.line.double-slash.http"
169-
},
168+
"name": "comment.line.sharp.http"
169+
},
170+
{
171+
"match": "^\\s*\\#{1,}\\s+(?:((@)requestCount)\\s+([^\\s\\.]+))$",
172+
"captures": {
173+
"1": {
174+
"name": "entity.other.attribute-name"
175+
},
176+
"2": {
177+
"name": "punctuation.definition.block.tag.metadata"
178+
},
179+
"3": {
180+
"name": "entity.name.type.http"
181+
}
182+
},
183+
"name": "comment.line.sharp.http"
184+
},
170185
{
171186
"match": "^\\s*\\#{1,}\\s+((@)note)\\s*$",
172187
"captures": {

0 commit comments

Comments
 (0)