Skip to content

Commit

Permalink
tweak logging
Browse files Browse the repository at this point in the history
Signed-off-by: Chengxuan Xing <[email protected]>
  • Loading branch information
Chengxuan committed Jun 5, 2024
1 parent 2fb3659 commit 29fd9ed
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions internal/perf/perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ type perfRunner struct {
summary summary
msgTimeMap sync.Map

rampSummary int64
totalSummary int64
poolName string
poolConnectorName string
tagPrefix string
Expand Down Expand Up @@ -586,7 +584,7 @@ perfLoop:
if pr.cfg.NoWaitSubmission {
eventsCount := getMetricVal(receivedEventsCounter)
submissionCount := getMetricVal(totalActionsCounter)
log.Infof("<No wait submission mode> Wait for the event count %f to reach request sent count %f, within 5s", eventsCount, submissionCount)
log.Infof("<No wait submission mode> Wait for the event count %f to reach request sent count %f, within 30s", eventsCount, submissionCount)
for {
if eventsCount == submissionCount {
break
Expand All @@ -596,7 +594,7 @@ perfLoop:
}

// Check if more than 1 minute has passed
if time.Since(tallyStart) > 5*time.Second {
if time.Since(tallyStart) > 30*time.Second {
log.Errorf("The number of events received %f doesn't tally up to the number of requests sent %f after %s.", eventsCount, submissionCount, time.Since(time.Unix(pr.startTime, 0)))
break
}
Expand Down Expand Up @@ -699,9 +697,9 @@ func (pr *perfRunner) filterEvent(event core.EventDelivery, url string) (workerI
}
workerID, err = strconv.Atoi(value)
if err != nil {
log.Errorf("Could not parse event value: %s", err)
log.Errorf("Could not extract worker ID from event value: %s due to %+v", value, err)
b, _ := json.Marshal(&event)
log.Infof("Full event: %s", b)
log.Debugf("Full event: %s", b)
} else {
log.Infof("\n\t%d - Received from %s\n\t%d --- Event ID: %s\n\t%d --- Ref: %s", workerID, url, workerID, event.ID.String(), workerID, event.Reference)
}
Expand All @@ -712,9 +710,9 @@ func (pr *perfRunner) filterEvent(event core.EventDelivery, url string) (workerI
if len(uriElements) == 2 {
workerID, err = strconv.Atoi(uriElements[1])
if err != nil {
log.Errorf("Could not parse event value: %s", err)
log.Errorf("Could not extract worker ID from uri: %s due to %+v", uriElements[1], err)
b, _ := json.Marshal(&event)
log.Infof("Full event: %s", b)
log.Debugf("Full event: %s", b)
} else {
log.Infof("\n\t%d - Received from %s\n\t%d --- Event ID: %s\n\t%d --- Ref: %s", workerID, url, workerID, event.ID.String(), workerID, event.Reference)
}
Expand Down Expand Up @@ -751,9 +749,9 @@ func (pr *perfRunner) filterEvent(event core.EventDelivery, url string) (workerI

workerID, err = strconv.Atoi(workerIDFromTag)
if err != nil {
log.Errorf("Could not parse message tag: %s", err)
log.Errorf("Could not extract worker ID from message tag: %s due to %+v", workerIDFromTag, err)
b, _ := json.Marshal(&event)
log.Infof("Full event: %s", b)
log.Debugf("Full event: %s", b)
}

var dataID *fftypes.UUID
Expand Down Expand Up @@ -964,7 +962,7 @@ func (pr *perfRunner) runLoop(tc TestCase) error {
actionCount := actionsCompleted
go func() {
trackingID, err := tc.RunOnce(actionCount)
log.Infof("%d --> %s action %d sent after %f seconds", workerID, testName, actionCount, time.Since(startTime).Seconds())
log.Debugf("%d --> %s action %d sent after %f seconds", workerID, testName, actionCount, time.Since(startTime).Seconds())
actionResponses <- &ActionResponse{
trackingID: trackingID,
err: err,
Expand Down Expand Up @@ -1046,7 +1044,7 @@ func (pr *perfRunner) runLoop(tc TestCase) error {
}

if histErr == nil {
log.Infof("%d <-- %s Emmiting (loop=%d) after %f seconds", workerID, testName, loop, secondsPerLoop)
log.Debugf("%d <-- %s Emmiting (loop=%d) after %f seconds", workerID, testName, loop, secondsPerLoop)

hist.Observe(secondsPerLoop)
}
Expand Down

0 comments on commit 29fd9ed

Please sign in to comment.