aboutsummaryrefslogtreecommitdiff
path: root/weed/command/benchmark.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-02-09 21:56:32 -0800
committerChris Lu <chris.lu@gmail.com>2019-02-09 21:56:32 -0800
commit4ff4a147b258bb7787e492a74254f3993bb69d1a (patch)
tree304dd8cba4ce415b7a9312f90760c8d086793b77 /weed/command/benchmark.go
parent501bd72b1c9a88cadb5182cf9c13c2d796cf775f (diff)
downloadseaweedfs-4ff4a147b258bb7787e492a74254f3993bb69d1a.tar.xz
seaweedfs-4ff4a147b258bb7787e492a74254f3993bb69d1a.zip
cleanup security.Secret
Diffstat (limited to 'weed/command/benchmark.go')
-rw-r--r--weed/command/benchmark.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index 60fd88ccd..be76a3e2e 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -17,7 +17,6 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
- "github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/wdclient"
)
@@ -35,7 +34,6 @@ type BenchmarkOptions struct {
collection *string
cpuprofile *string
maxCpu *int
- secretKey *string
}
var (
@@ -59,7 +57,6 @@ func init() {
b.collection = cmdBenchmark.Flag.String("collection", "benchmark", "write data to this collection")
b.cpuprofile = cmdBenchmark.Flag.String("cpuprofile", "", "cpu profile output file")
b.maxCpu = cmdBenchmark.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
- b.secretKey = cmdBenchmark.Flag.String("secure.secret", "", "secret to encrypt Json Web Token(JWT)")
sharedBytes = make([]byte, 1024)
}
@@ -188,7 +185,6 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
defer wait.Done()
delayedDeleteChan := make(chan *delayedFile, 100)
var waitForDeletions sync.WaitGroup
- secret := security.Secret(*b.secretKey)
for i := 0; i < 7; i++ {
waitForDeletions.Add(1)
@@ -198,8 +194,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
if df.enterTime.After(time.Now()) {
time.Sleep(df.enterTime.Sub(time.Now()))
}
- if e := util.Delete("http://"+df.fp.Server+"/"+df.fp.Fid,
- security.GenJwt(secret, df.fp.Fid)); e == nil {
+ if e := util.Delete("http://"+df.fp.Server+"/"+df.fp.Fid, ""); e == nil {
s.completed++
} else {
s.failed++
@@ -224,7 +219,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
}
if assignResult, err := operation.Assign(masterClient.GetMaster(), ar); err == nil {
fp.Server, fp.Fid, fp.Collection = assignResult.Url, assignResult.Fid, *b.collection
- if _, err := fp.Upload(0, masterClient.GetMaster(), secret); err == nil {
+ if _, err := fp.Upload(0, masterClient.GetMaster(), ""); err == nil {
if random.Intn(100) < *b.deletePercentage {
s.total++
delayedDeleteChan <- &delayedFile{time.Now().Add(time.Second), fp}