Skip to content

Commit

Permalink
also implement the analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Nov 24, 2023
1 parent 5ad88d5 commit 132ba4d
Show file tree
Hide file tree
Showing 6 changed files with 1,039 additions and 157 deletions.
20 changes: 14 additions & 6 deletions internal/cmd/minipipeline/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ func main() {
container.NoteHTTPRoundTripResults(meas.TestKeys.Unwrap().Requests...)
container.NoteControlResults(meas.TestKeys.Unwrap().XControlRequest.Unwrap(), meas.TestKeys.Unwrap().Control.Unwrap())

must.WriteFile("db.json", must.MarshalJSON(container), 0600)
must.WriteFile("observation.json", must.MarshalJSON(container), 0600)

/*
ax := &pipeline.Analysis{}
ax.ComputeAllValues(db)
analysis := &minipipeline.WebAnalysis{}
analysis.ComputeDNSExperimentFailure(container)
analysis.ComputeDNSTransactionsWithBogons(container)
analysis.ComputeDNSTransactionsWithUnexpectedFailures(container)
analysis.ComputeDNSPossiblyInvalidAddrs(container)
analysis.ComputeTCPTransactionsWithUnexpectedTCPConnectFailures(container)
analysis.ComputeTCPTransactionsWithUnexpectedTLSHandshakeFailures(container)
analysis.ComputeTCPTransactionsWithUnexpectedHTTPFailures(container)
analysis.ComputeHTTPDiffBodyProportionFactor(container)
analysis.ComputeHTTPDiffStatusCodeMatch(container)
analysis.ComputeHTTPDiffUncommonHeadersIntersection(container)
analysis.ComputeHTTPDiffTitleDifferentLongWords(container)

must.WriteFile("ax.json", must.MarshalJSON(ax), 0600)
*/
must.WriteFile("analysis.json", must.MarshalJSON(analysis), 0600)
}
15 changes: 11 additions & 4 deletions internal/experiment/webconnectivitylte/analysiscore.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const (
analysisFlagSuccess
)

// AnalysisUseV2 indicates whether to use V2 of the analysis algorithm.
var AnalysisUseV2 = true

// analysisToplevel is the toplevel function that analyses the results
// of the experiment once all network tasks have completed.
//
Expand Down Expand Up @@ -99,10 +102,14 @@ func (tk *TestKeys) analysisToplevel(logger model.Logger) {
// not going to use any form of locking here.

// these functions compute the value of XBlockingFlags
tk.analysisDNSToplevel(logger, model.GeoIPASNLookupperFunc(geoipx.LookupASN))
tk.analysisTCPIPToplevel(logger)
tk.analysisTLSToplevel(logger)
tk.analysisHTTPToplevel(logger)
if AnalysisUseV2 {
tk.analysisToplevelV2(logger)
} else {
tk.analysisDNSToplevel(logger, model.GeoIPASNLookupperFunc(geoipx.LookupASN))
tk.analysisTCPIPToplevel(logger)
tk.analysisTLSToplevel(logger)
tk.analysisHTTPToplevel(logger)
}

// now, let's determine .Accessible and .Blocking
switch {
Expand Down
Loading

0 comments on commit 132ba4d

Please sign in to comment.