ooni-probe-cli/nettests/performance/dash.go
Arturo Filastò 0c5b6aa37c Rename gooni to probe-cli
This is the command I used:
```
rg 'github.com/openobservatory/gooni' --files-with-matches \
    | xargs sed -i '' 's/github.com\/openobservatory\/gooni/github.com\/ooni\/probe-cli/g'
```
2018-05-03 14:59:55 +02:00

42 lines
952 B
Go

package performance
import (
"github.com/measurement-kit/go-measurement-kit"
"github.com/ooni/probe-cli/nettests"
)
// Dash test implementation
type Dash struct {
}
// Run starts the test
func (d Dash) Run(ctl *nettests.Controller) error {
dash := mk.NewNettest("Dash")
ctl.Init(dash)
return dash.Run()
}
// DashSummary for the test
// TODO: process 'receiver_data' to provide an array of performance for a chart.
type DashSummary struct {
Latency float64
Bitrate int64
Delay float64
}
// Summary generates a summary for a test run
func (d Dash) Summary(tk map[string]interface{}) interface{} {
simple := tk["simple"].(map[string]interface{})
return DashSummary{
Latency: simple["connect_latency"].(float64),
Bitrate: int64(simple["median_bitrate"].(float64)),
Delay: simple["min_playout_delay"].(float64),
}
}
// LogSummary writes the summary to the standard output
func (d Dash) LogSummary(s string) error {
return nil
}