Skip to content

Commit

Permalink
adding partition attributes to faker generator
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaIguazio committed Jul 16, 2019
1 parent 35053bd commit 012575d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions httpblaster/data_generator/fakerGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (self *Fake) Init() {
}

func (self *Fake) GenerateRandomData() string {
t := time.Now()
t := time.Now().AddDate(0, 0, 0)
self.Key = randomBase64String(16)

self.Name = gofakeit.Name() // Markus Moen
Expand Down Expand Up @@ -75,7 +75,10 @@ func (self *Fake) ConvertToIgzEmdItemJson() string {
emdItem := igz_data.IgzEmdItem{}
emdItem.ToJsonString()
emdItem.InitItem()
emdItem.InsertKey("key", igz_data.T_STRING, self.Key)
err := emdItem.InsertKey("key", igz_data.T_STRING, self.Key)
if err != nil {
log.Error(err)
}
emdItem.InsertItemAttr("Name", igz_data.T_STRING, self.Name)
emdItem.InsertItemAttr("Email", igz_data.T_STRING, self.Email)
emdItem.InsertItemAttr("Phone", igz_data.T_STRING, self.Phone)
Expand Down
3 changes: 2 additions & 1 deletion httpblaster/utils/partitioned_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func PrintTime() {
}

func GeneratePartitionedRequest(partition_by string) string {
t := time.Now()
//t := time.Now()
t := time.Now().AddDate(0, 0, 0)
if partition_by == "year" {
return fmt.Sprintf("/year=%d/",
t.Year())
Expand Down

0 comments on commit 012575d

Please sign in to comment.