-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rewrite the pipeline to match ooni/data more closely
- Loading branch information
1 parent
ff42f3c
commit 5ad88d5
Showing
10 changed files
with
566 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/ooni/probe-cli/v3/internal/minipipeline" | ||
"github.com/ooni/probe-cli/v3/internal/must" | ||
"github.com/ooni/probe-cli/v3/internal/pipeline" | ||
) | ||
|
||
func main() { | ||
rawMeasurement := must.ReadFile(os.Args[1]) | ||
var meas pipeline.CanonicalMeasurement | ||
must.UnmarshalJSON(rawMeasurement, &meas) | ||
|
||
container := minipipeline.NewWebObservationsContainer() | ||
container.CreateDNSLookupFailures(meas.TestKeys.Unwrap().Queries...) | ||
container.CreateKnownIPAddresses(meas.TestKeys.Unwrap().Queries...) | ||
container.CreateKnownTCPEndpoints(meas.TestKeys.Unwrap().TCPConnect...) | ||
container.NoteTLSHandshakeResults(meas.TestKeys.Unwrap().TLSHandshakes...) | ||
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) | ||
|
||
/* | ||
ax := &pipeline.Analysis{} | ||
ax.ComputeAllValues(db) | ||
must.WriteFile("ax.json", must.MarshalJSON(ax), 0600) | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Package minipipeline implements a minimal data processing pipeline used | ||
// to analyze local measurements collected by OONI Probe. | ||
package minipipeline |
Oops, something went wrong.