Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 2 more tags in log for comparator to use. #5646

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

bowenxia
Copy link
Contributor

@bowenxia bowenxia commented Feb 6, 2024

What changed?
Added 2 more tags in log for comparator to use.

Why?
We will need user's earliest time and latest time info in the response comparator.
Previously we didn't need it because we were testing the functionality of the comparator. In order to made it stable, we used our own hard coded earliest time and latest time. But this is not useful any more for the testing right now.

How did you test it?
manual testing

Potential risks
nah

Release notes

Documentation Changes

common/persistence/pinotVisibilityTripleManager.go Outdated Show resolved Hide resolved
@@ -51,6 +51,14 @@ func Timestamp(timestamp time.Time) Tag {
return newTimeTag("timestamp", timestamp)
}

func EarliestTime(time int64) Tag {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I may suggest making it *int65

Suggested change
func EarliestTime(time int64) Tag {
func EarliestTime(time *int64) Tag {
if time == nil {
return newInt64("earliest-time", -1)
}
return newInt64("earliest-time", time)
}

Comment on lines 342 to 343
if userParam.earlistTime == nil && userParam.latestTime == nil {
v.logger.Info("Logging user query parameters for Pinot/ES response comparator with custom query...",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm nitpicking, but I'd suggest pulling the responsibility for handling nil behaviour into the tag (as per the tag discussion) and avoiding branching an if here

@coveralls
Copy link

coveralls commented Feb 6, 2024

Pull Request Test Coverage Report for Build 018d81dd-9baa-4615-b890-3a319df8a01f

  • -66 of 66 (0.0%) changed or added relevant lines in 2 files are covered.
  • 106 unchanged lines in 20 files lost coverage.
  • Overall coverage decreased (-0.06%) to 62.624%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/log/tag/tags.go 0 6 0.0%
common/persistence/pinotVisibilityTripleManager.go 0 60 0.0%
Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
common/persistence/historyManager.go 2 66.67%
common/persistence/sql/common.go 2 72.73%
common/persistence/sql/sqlplugin/mysql/db.go 2 83.33%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
common/persistence/sql/sqlplugin/postgres/db.go 2 85.0%
common/persistence/sql/sqlplugin/postgres/task.go 2 73.4%
common/task/parallel_task_processor.go 2 93.06%
service/matching/db.go 2 73.23%
service/matching/taskListManager.go 2 79.7%
Totals Coverage Status
Change from base Build 018d8155-19ec-487b-9515-1a255405ce1f: -0.06%
Covered Lines: 92094
Relevant Lines: 147059

💛 - Coveralls

@@ -452,10 +472,15 @@ func (v *pinotVisibilityTripleManager) GetClosedWorkflowExecution(
ctx context.Context,
request *GetClosedWorkflowExecutionRequest,
) (*GetClosedWorkflowExecutionResponse, error) {
earlistTime := int64(0) // this is to get all closed workflow execution
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you want to hardcode these values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. My understanding for GetClosedWorkflowExecutionRequest is to get all the closed workflow. Am I correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so? Like this should be for a time range?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, Bowen correctly points out that the request struct doesn't have a lower bound (for whatever reason), so this value is not used here.

@@ -452,10 +472,15 @@ func (v *pinotVisibilityTripleManager) GetClosedWorkflowExecution(
ctx context.Context,
request *GetClosedWorkflowExecutionRequest,
) (*GetClosedWorkflowExecutionResponse, error) {
earlistTime := int64(0) // this is to get all closed workflow execution
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, Bowen correctly points out that the request struct doesn't have a lower bound (for whatever reason), so this value is not used here.

@bowenxia bowenxia merged commit a7d504a into master Feb 7, 2024
16 checks passed
@bowenxia bowenxia deleted the xbowen_add_time_range_in_log branch February 7, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants