fix up script

pull/9808/head
Priya Wadhwa 2020-11-23 12:56:48 -08:00
parent b5e1d7ef17
commit d370a3e164
2 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ const (
) )
var ( var (
// The task latency in milliseconds. // The task latency in seconds
latencyS = stats.Float64("repl/start_time", "start time in seconds", "s") latencyS = stats.Float64("repl/start_time", "start time in seconds", "s")
) )
@ -56,7 +56,7 @@ func main() {
func execute() error { func execute() error {
projectID := os.Getenv(projectEnvVar) projectID := os.Getenv(projectEnvVar)
if projectID == "" { if projectID == "" {
return nil, fmt.Errorf("GCP tracer requires a valid GCP project id set via the %s env variable", projectEnvVar) return fmt.Errorf("metrics collector requires a valid GCP project id set via the %s env variable", projectEnvVar)
} }
osMethod, err := tag.NewKey("os") osMethod, err := tag.NewKey("os")
@ -64,7 +64,7 @@ func execute() error {
return errors.Wrap(err, "new tag key") return errors.Wrap(err, "new tag key")
} }
ctx, err := tag.New(context.Background(), tag.Insert(osMethod, runtime.GOOS), tag.Insert(driverMethod, "docker")) ctx, err := tag.New(context.Background(), tag.Insert(osMethod, runtime.GOOS))
if err != nil { if err != nil {
return errors.Wrap(err, "new tag") return errors.Wrap(err, "new tag")
} }
@ -102,17 +102,16 @@ func execute() error {
} }
defer sd.StopMetricsExporter() defer sd.StopMetricsExporter()
// Record 2p0 start time values
for { for {
st := minikubeStartTime(ctx) st := minikubeStartTime(ctx)
fmt.Printf("Latency: %f\n", st) fmt.Printf("Latency: %f\n", st)
stats.Record(ctx, latencyS.M(st)) stats.Record(ctx, latencyS.M(st))
time.Sleep(2 * time.Second) time.Sleep(30 * time.Second)
} }
} }
func minikubeStartTime(ctx context.Context) (float64, error) { func minikubeStartTime(ctx context.Context) (float64, error) {
defer deleteMinikube(ctx, profile) defer deleteMinikube(ctx)
minikube := filepath.Join(os.Getenv("HOME"), "minikube/out/minikube") minikube := filepath.Join(os.Getenv("HOME"), "minikube/out/minikube")

View File

@ -87,6 +87,7 @@ minikube start [flags]
--preload If set, download tarball of preloaded images if available to improve start time. Defaults to true. (default true) --preload If set, download tarball of preloaded images if available to improve start time. Defaults to true. (default true)
--registry-mirror strings Registry mirrors to pass to the Docker daemon --registry-mirror strings Registry mirrors to pass to the Docker daemon
--service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12") --service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12")
--trace string Send trace events. Options include: [gcp]
--uuid string Provide VM UUID to restore MAC address (hyperkit driver only) --uuid string Provide VM UUID to restore MAC address (hyperkit driver only)
--vm Filter to use only VM Drivers --vm Filter to use only VM Drivers
--vm-driver driver DEPRECATED, use driver instead. --vm-driver driver DEPRECATED, use driver instead.