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

fixing metrics #1194

Merged
merged 7 commits into from
Aug 10, 2023
Merged

fixing metrics #1194

merged 7 commits into from
Aug 10, 2023

Conversation

dhrubo-os
Copy link
Collaborator

Description

[fixing metrics]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 17:48 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 17:48 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 17:48 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 17:48 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1194 (6e08ffa) into 2.9 (4ac47f6) will increase coverage by 0.02%.
The diff coverage is 63.63%.

@@             Coverage Diff              @@
##                2.9    #1194      +/-   ##
============================================
+ Coverage     78.75%   78.77%   +0.02%     
- Complexity     2122     2125       +3     
============================================
  Files           167      167              
  Lines          8678     8683       +5     
  Branches        871      871              
============================================
+ Hits           6834     6840       +6     
+ Misses         1448     1445       -3     
- Partials        396      398       +2     
Flag Coverage Δ
ml-commons 78.77% <63.63%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...java/org/opensearch/ml/utils/MLExceptionUtils.java 86.36% <50.00%> (ø)
...n/java/org/opensearch/ml/model/MLModelManager.java 62.79% <66.66%> (-0.03%) ⬇️

... and 1 file with indirect coverage changes

@@ -836,6 +837,7 @@ public void deployModel(

private void handleDeployModelException(String modelId, FunctionName functionName, ActionListener<String> listener, Exception e) {
mlStats.createCounterStatIfAbsent(functionName, ActionName.DEPLOY, MLActionLevelStat.ML_ACTION_FAILURE_COUNT).increment();
mlStats.getStat(MLNodeLevelStat.ML_NODE_TOTAL_FAILURE_COUNT).increment();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should only track the real internal server failure. For example, some exception are expected (which means that's not a code bug) like illegal input parameter. You can refer to other place

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree, addressed.

Signed-off-by: Dhrubo Saha <[email protected]>
Signed-off-by: Dhrubo Saha <[email protected]>
Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 22:43 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 22:43 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 22:43 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 9, 2023 22:43 — with GitHub Actions Inactive
@@ -689,7 +689,10 @@ private void deleteModel(String modelId) {
}

private void handleException(FunctionName functionName, String taskId, Exception e) {
mlStats.createCounterStatIfAbsent(functionName, REGISTER, MLActionLevelStat.ML_ACTION_FAILURE_COUNT).increment();
if (!(e instanceof MLLimitExceededException) && !(e instanceof MLResourceNotFoundException)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks , how about also check IllegalArgumentException which is generally user's input is wrong, we should not treat it as some internal failure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. In that case, may be we can add same exception here also, what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, sounds good

Signed-off-by: Dhrubo Saha <[email protected]>
Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 10, 2023 02:30 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 10, 2023 02:30 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 10, 2023 02:30 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 10, 2023 02:30 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os merged commit deb0008 into opensearch-project:2.9 Aug 10, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 10, 2023
* fixing metrics

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* updating test

Signed-off-by: Dhrubo Saha <[email protected]>

* added IllegalArgumentException in the if statement

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* fixing spotless

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit deb0008)
@dhrubo-os dhrubo-os deleted the 2.9 branch August 17, 2023 19:00
ylwu-amzn pushed a commit to ylwu-amzn/ml-commons that referenced this pull request Aug 18, 2023
* fixing metrics

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* updating test

Signed-off-by: Dhrubo Saha <[email protected]>

* added IllegalArgumentException in the if statement

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* fixing spotless

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
ylwu-amzn added a commit that referenced this pull request Aug 18, 2023
* fixing metrics



* addressing comments



* addressing comments



* updating test



* added IllegalArgumentException in the if statement



* addressing comments



* fixing spotless



---------

Signed-off-by: Dhrubo Saha <[email protected]>
Co-authored-by: Dhrubo Saha <[email protected]>
zane-neo pushed a commit to zane-neo/ml-commons that referenced this pull request Sep 1, 2023
* fixing metrics



* addressing comments



* addressing comments



* updating test



* added IllegalArgumentException in the if statement



* addressing comments



* fixing spotless



---------

Signed-off-by: Dhrubo Saha <[email protected]>
Co-authored-by: Dhrubo Saha <[email protected]>
zane-neo pushed a commit that referenced this pull request Sep 1, 2023
* fixing metrics



* addressing comments



* addressing comments



* updating test



* added IllegalArgumentException in the if statement



* addressing comments



* fixing spotless



---------

Signed-off-by: Dhrubo Saha <[email protected]>
Co-authored-by: Dhrubo Saha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants