Skip to content

Commit

Permalink
Merge 77ac5c3 into a5bc910
Browse files Browse the repository at this point in the history
  • Loading branch information
l-w-2017 committed Sep 27, 2018
2 parents a5bc910 + 77ac5c3 commit 68fb1d4
Show file tree
Hide file tree
Showing 11 changed files with 282 additions and 253 deletions.
12 changes: 6 additions & 6 deletions benchmarks/runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package main
import (
"bufio"
"bytes"
"encoding/json"
"flag"
"io/ioutil"
"os"
Expand All @@ -37,6 +36,7 @@ import (
"github.com/uber/zanzibar/test/lib/util"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
yaml "gopkg.in/yaml.v2"
)

var logger = zap.New(
Expand Down Expand Up @@ -69,23 +69,23 @@ func spawnBenchServer(dirName string) *exec.Cmd {
}

func writeConfigToFile(config map[string]interface{}) (string, error) {
tempConfigDir, err := ioutil.TempDir("", "zanzibar-bench-config-json")
tempConfigDir, err := ioutil.TempDir("", "zanzibar-bench-config-yaml")
if err != nil {
return "", err
}

jsonFile := path.Join(tempConfigDir, "production.json")
configBytes, err := json.Marshal(config)
yamlFile := path.Join(tempConfigDir, "production.json")
configBytes, err := yaml.Marshal(config)
if err != nil {
return "", err
}

err = ioutil.WriteFile(jsonFile, configBytes, os.ModePerm)
err = ioutil.WriteFile(yamlFile, configBytes, os.ModePerm)
if err != nil {
return "", err
}

return jsonFile, nil
return yamlFile, nil
}

func spawnGateway(dirName string) *exec.Cmd {
Expand Down

0 comments on commit 68fb1d4

Please sign in to comment.