-
Notifications
You must be signed in to change notification settings - Fork 25
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
Modify clickhouse statistic related func for theia-manager #132
Conversation
/theia-test-e2e |
4017672
to
07468bc
Compare
/theia-test-e2e |
07468bc
to
1160f1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm. some nits.
5df9906
to
a1c7d59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. one simple nit.
a1c7d59
to
74a2b2a
Compare
@@ -0,0 +1,115 @@ | |||
// Copyright 2022 Antrea Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried to move some utility functions to the common pkg in PR #138 . I think most of the functions are similar and the later merged PR can fix the conflicts, but I would like to get some feedbacks about if we prefer to put all these functions in one file like this one, or classify them into multiple pkgs like clickhouse, policyrecommendation, k8s as I do in PR #138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinion regarding this, but I might prefer classifying them into multiple pkgs.
74a2b2a
to
5563fc4
Compare
Signed-off-by: Yun-Tang Hsu <[email protected]>
Signed-off-by: Yun-Tang Hsu <[email protected]>
8f9232e
to
ea35d5c
Compare
Signed-off-by: Yun-Tang Hsu <[email protected]>
4769b15
to
cded8f6
Compare
/theia-test-e2e |
cded8f6
to
e63a611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, just some nits inline
@@ -339,7 +339,7 @@ function deliver_antrea { | |||
|
|||
${GIT_CHECKOUT_DIR}/hack/generate-manifest.sh --ch-size 100Mi --ch-monitor-threshold 0.1 > ${GIT_CHECKOUT_DIR}/build/yamls/flow-visibility.yml | |||
${GIT_CHECKOUT_DIR}/hack/generate-manifest.sh --no-grafana --spark-operator --theia-manager > ${GIT_CHECKOUT_DIR}/build/yamls/flow-visibility-with-spark.yml | |||
${GIT_CHECKOUT_DIR}/hack/generate-manifest.sh --no-grafana > ${GIT_CHECKOUT_DIR}/build/yamls/flow-visibility-ch-only.yml | |||
${GIT_CHECKOUT_DIR}/hack/generate-manifest.sh --no-grafana --theia-manager > ${GIT_CHECKOUT_DIR}/build/yamls/flow-visibility-ch-only.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were we lacking theia manager in the manifests we use for testing before this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stats.StackTraces = append(stats.StackTraces, res) | ||
} | ||
if err != nil { | ||
return fmt.Errorf("failed to parse the data returned by database: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to make a little less ignorant... can this query return multiple rows?
In that case, would it better to skip and move to the next record if we fail to parse a record?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query returns multiple rows.
I think it is a good idea to skip the error row instead of throwing away the whole data?
cc @yanjunz97 and @wsquan171 for some feedbacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree to skip the error row. It would be better if we could display the results retrieved successfully and the error regarding to the error row at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a ErrorMsg, which is a []string, in ClickHouseStats. If we have an error row, we will skip it and add the error msg to ErrorMsg. On CLI side, it will show both ErrorMsgs and the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new approach looks good to me.
Signed-off-by: Yun-Tang Hsu <[email protected]>
e63a611
to
bdaa510
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/theia-test-e2e |
This PR modifies and adds the clickhouse statistic related functions for Theia Manager:
a. REST endpoint apis/stats.theia.antrea.io/v1alpha1/clickhouse
The changes are split into two chunks (to hopefully help make reviews easier), with one commit focusing on adding status API, another one implementing the CLI changes and modifying the e2e test,
Signed-off-by: Yun-Tang Hsu [email protected]