Skip to content

[Internal] Code Analysis Rules: Fixes analyzer issues in Exception classes.#5099

Merged
microsoft-github-policy-service[bot] merged 11 commits intomasterfrom
users/aavasthy/enable_analyzers_logging
Apr 1, 2025
Merged

[Internal] Code Analysis Rules: Fixes analyzer issues in Exception classes.#5099
microsoft-github-policy-service[bot] merged 11 commits intomasterfrom
users/aavasthy/enable_analyzers_logging

Conversation

@aavasthy
Copy link
Copy Markdown
Contributor

@aavasthy aavasthy commented Mar 28, 2025

Pull Request Template

Description

Integrating exception handling analyzers rules with Cosmos project. These rules will enhance stability, prevent performance pitfalls, and ensure better logging practices. Also, suppressing the rules in certain places where logging full stack trace is necessary. This PR covers primarily Exception related classes.

Performance tests in master branch:

Method Type EnableBinaryResponseOnPointOperations Mean (µs) Error (µs) StdDev (µs) P90 (µs) P95 (µs) P100 (µs) Op/s Gen0 Allocated
CreateItem Stream False 298.62 3.44 3.22 302.51 303.68 305.26 3,348.72 1.4648 26793 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False Stream False 293.50 3.65 3.42 298.33 299.08 299.83 3,407.17 1.4648 26794 B
DeleteItemExists Stream False 300.57 4.27 3.79 305.14 307.27 310.32 3,326.97 1.4648 26810 B
DeleteItemNotExists Stream False 320.20 4.38 4.09 324.52 325.98 327.49 3,123.06 2.4414 40025 B
ReadFeed Stream False 357.41 6.62 6.51 366.23 368.86 369.54 2,797.91 1.9531 36963 B
ReadItemExists Stream False 321.23 3.58 2.99 323.75 325.50 327.79 3,113.08 1.4648 28089 B
ReadItemNotExists Stream False 341.28 5.72 5.35 347.59 348.10 349.03 2,930.18 2.4414 41293 B
UpdateItem Stream False 297.01 3.59 3.19 300.65 301.38 302.28 3,366.87 1.4648 27002 B
UpsertItem Stream False 300.65 5.63 5.26 305.01 307.38 312.73 3,326.08 1.4648 27006 B
QuerySinglePartitionOnePage Stream False 2564.54 14.57 12.17 2578.23 2581.78 2586.88 389.93 58.5938 996767 B
QuerySinglePartitionMultiplePages Stream False 15267.89 47.63 42.22 15326.44 15338.37 15341.00 65.50 343.75 5880526 B
CreateItem Stream True 298.07 2.73 2.42 301.19 301.91 302.77 3,354.93 1.4648 27766 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False Stream True 309.31 3.34 2.96 313.80 314.34 314.34 3,232.97 1.4648 29648 B
DeleteItemExists Stream True 306.23 2.56 2.27 308.96 309.65 310.26 3,265.52 1.4648 27246 B
DeleteItemNotExists Stream True 337.83 5.73 5.63 345.83 348.08 349.93 2,960.05 1.9531 35828 B
ReadFeed Stream True 355.30 6.49 6.07 362.33 363.57 365.40 2,814.52 1.9531 36971 B
ReadItemExists Stream True 327.99 6.21 6.37 334.79 338.23 339.62 3,048.85 1.4648 28529 B
ReadItemNotExists Stream True 354.90 3.51 3.11 358.33 359.42 361.20 2,817.66 1.9531 37092 B
UpdateItem Stream True 307.85 4.42 3.91 311.92 312.19 312.66 3,248.34 1.4648 27979 B
UpsertItem Stream True 310.13 6.17 9.05 323.30 323.92 324.70 3,224.41 1.4648 28569 B
QuerySinglePartitionOnePage Stream True 2547.10 13.13 10.25 2553.99 2562.13 2571.72 392.60 58.5938 996763 B
QuerySinglePartitionMultiplePages Stream True 15271.09 89.96 75.12 15334.47 15338.17 15343.42 65.48 343.75 5880719 B
CreateItem OfT False 323.48 2.48 2.07 326.06 326.34 326.47 3,091.37 1.9531 38537 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False OfT False 0.01 0.00 0.00 0.01 0.01 0.01 73,066,308.61 - -
DeleteItemExists OfT False 319.05 2.17 1.81 320.29 321.89 322.44 3,134.28 1.9531 34554 B
DeleteItemNotExists OfT False 391.12 3.54 3.31 395.50 396.20 397.32 2,556.78 2.4414 43436 B
ReadFeed OfT False 2029.51 7.11 6.66 2039.60 2042.04 2042.66 492.73 31.25 538238 B
ReadItemExists OfT False 346.53 5.90 5.52 352.76 352.88 354.15 2,885.73 1.9531 35811 B
ReadItemNotExists OfT False 405.45 3.66 3.25 409.30 409.57 409.94 2,466.38 1.9531 44705 B
UpdateItem OfT False 333.98 6.46 6.64 343.40 345.68 346.49 2,994.15 1.9531 38745 B
UpsertItem OfT False 336.87 6.55 7.54 347.87 351.73 352.27 2,968.51 1.9531 41297 B
QuerySinglePartitionOnePage OfT False 4853.18 93.51 134.12 4984.12 5078.05 5153.95 206.05 101.56 2184586 B
QuerySinglePartitionMultiplePages OfT False 29185.41 417.55 390.58 29575.65 29584.94 29591.58 34.26 593.75 13006177 B
CreateItem OfT False 343.09 2.56 2.00 345.05 345.95 347.00 2,914.70 1.9531 34781 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False OfT False 0.01 0.00 0.00 0.01 0.01 0.01 71,558,237.41 - -
DeleteItemExists OfT False 327.41 4.76 4.22 331.34 333.39 335.29 3,054.24 1.4648 30067 B
DeleteItemNotExists OfT False 395.30 4.27 3.99 400.34 401.55 402.10 2,529.75 1.9531 39050 B
ReadFeed OfT False 2026.36 9.99 9.35 2037.72 2038.93 2040.85 493.50 31.25 538229 B
ReadItemExists OfT False 350.31 5.96 5.28 356.28 357.49 358.94 2,854.61 1.9531 31354 B
ReadItemNotExists OfT False 409.55 5.46 5.10 416.43 417.63 419.87 2,441.68 1.9531 40324 B
UpdateItem OfT False 347.23 4.33 4.05 350.79 352.32 355.43 2,879.90 1.9531 35012 B
UpsertItem OfT False 354.04 4.29 4.01 359.55 359.84 360.31 2,824.53 1.9531 34997 B
QuerySinglePartitionOnePage OfT False 4833.96 67.22 59.59 4887.08 4909.85 4946.76 206.87 101.56 2184671 B
QuerySinglePartitionMultiplePages OfT False 29571.21 525.13 491.21 29334.47 29338.17 29343.42 65.48 593.75 13006177 B

Performance test result after change:

Method Type EnableBinaryResponseOnPointOperations Mean (µs) Error (µs) StdDev (µs) P90 (µs) P95 (µs) P100 (µs) Op/s Gen0 Allocated
CreateItem Stream False 309.95 5.63 5.78 316.18 318.85 324.13 3,226.29 1.4648 26828 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False Stream False 297.41 5.89 6.05 303.29 305.38 312.85 3,362.38 1.4648 26785 B
DeleteItemExists Stream False 304.97 5.83 5.72 311.76 313.26 316.19 3,279.06 1.4648 26819 B
DeleteItemNotExists Stream False 322.46 5.78 5.41 329.92 330.20 330.51 3,101.18 2.4414 40026 B
ReadFeed Stream False 358.19 7.04 8.38 366.07 370.52 375.58 2,791.81 1.9531 39854 B
ReadItemExists Stream False 323.67 3.36 2.62 326.31 326.62 326.90 3,089.60 1.4648 28083 B
ReadItemNotExists Stream False 340.32 5.56 4.93 346.16 347.27 349.04 2,938.40 2.4414 41303 B
UpdateItem Stream False 296.51 4.05 3.16 299.90 300.13 300.22 3,372.52 1.4648 27034 B
UpsertItem Stream False 298.76 3.93 3.49 302.42 302.75 303.10 3,347.11 1.4648 26994 B
QuerySinglePartitionOnePage Stream False 2502.77 10.76 10.07 2514.51 2518.60 2520.50 399.56 58.5938 996775 B
QuerySinglePartitionMultiplePages Stream False 16028.76 90.31 84.48 16076.09 16147.29 16156.73 62.39 343.75 5880642 B
CreateItem Stream True 298.84 3.51 3.11 302.63 303.81 305.58 3,346.31 1.4648 27778 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False Stream True 308.80 2.81 2.49 312.65 313.72 313.93 3,238.29 1.4648 29641 B
DeleteItemExists Stream True 307.42 5.97 5.59 315.43 317.64 318.78 3,252.92 1.4648 27266 B
DeleteItemNotExists Stream True 339.64 5.49 5.14 346.17 348.57 351.29 2,944.27 1.9531 35845 B
ReadFeed Stream True 354.00 6.26 5.86 362.97 364.14 364.97 2,824.86 1.9531 36954 B
ReadItemExists Stream True 329.20 5.00 4.43 333.45 334.50 336.40 3,037.68 1.4648 28538 B
ReadItemNotExists Stream True 354.45 4.31 4.03 359.28 360.34 362.09 2,821.29 1.9531 37099 B
UpdateItem Stream True 302.92 5.01 5.36 309.54 312.33 317.00 3,301.23 1.4648 27986 B
UpsertItem Stream True 305.08 5.71 5.06 313.40 315.42 315.72 3,277.86 1.4648 27970 B
QuerySinglePartitionOnePage Stream True 2500.07 17.19 16.08 2519.20 2522.95 2526.71 399.99 58.5938 996764 B
QuerySinglePartitionMultiplePages Stream True 15252.42 66.76 62.45 15317.89 15328.21 15339.60 65.56 343.75 5888955 B
CreateItem OfT False 330.92 5.60 4.97 335.58 336.14 337.14 3,021.92 1.9531 38522 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False OfT False 0.01 0.06 0.06 0.01 0.01 0.01 69,687,125.02 - -
DeleteItemExists OfT False 325.49 3.88 3.44 328.22 329.50 331.26 3,072.26 1.9531 34524 B
DeleteItemNotExists OfT False 393.82 7.73 7.23 404.79 407.05 407.49 2,539.26 2.4414 43428 B
ReadFeed OfT False 2109.14 14.32 12.70 2122.85 2131.02 2138.43 474.13 31.25 538238 B
ReadItemExists OfT False 351.33 6.72 6.60 358.20 361.21 362.63 2,846.32 1.9531 35805 B
ReadItemNotExists OfT False 414.06 6.13 5.44 420.64 422.08 423.30 2,415.14 1.9531 44689 B
UpdateItem OfT False 336.19 5.90 5.51 342.73 344.05 345.11 2,974.48 1.9531 38745 B
UpsertItem OfT False 343.39 6.34 10.76 351.61 359.75 371.80 2,912.15 1.9531 38888 B
QuerySinglePartitionOnePage OfT False 4786.99 95.60 110.09 4906.45 4940.55 5009.70 208.90 109.38 2184618 B
QuerySinglePartitionMultiplePages OfT False 29570.06 565.43 528.91 29902.47 30022.06 30592.09 33.82 562.50 13006347 B
CreateItem OfT True 343.29 4.66 4.13 348.67 350.42 351.73 2,913.00 1.9531 34793 B
CreateStreamItem_EnableBinaryResponseOnPointOperations_False OfT True 0.01 0.07 0.07 0.01 0.01 0.01 71,447,042.70 - -
DeleteItemExists OfT True 327.13 2.83 2.50 330.40 331.12 331.70 3,056.91 1.4648 30080 B
DeleteItemNotExists OfT True 392.30 3.11 2.75 395.59 396.99 400.23 2,549.04 1.9531 39082 B
ReadFeed OfT True 2074.32 15.91 13.29 2089.53 2097.96 2117.97 482.09 31.25 538230 B
ReadItemExists OfT True 349.51 5.00 4.68 355.12 356.71 357.96 2,861.14 1.9531 31366 B
ReadItemNotExists OfT True 412.53 3.25 2.71 415.29 415.47 415.64 2,424.07 1.9531 40332 B
UpdateItem OfT True 358.54 7.09 7.58 367.16 367.90 371.43 2,789.06 1.9531 35019 B
UpsertItem OfT True 352.48 6.11 5.71 359.58 361.67 362.15 2,837.03 1.9531 35001 B
QuerySinglePartitionOnePage OfT True 4762.18 88.68 82.95 4853.23 4894.10 4952.79 209.99 101.56 2184647 B
QuerySinglePartitionMultiplePages OfT True 29420.01 533.89 571.26 29971.62 30290.42 30610.08 33.99 562.50 13006198 B

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #IssueNumber

@aavasthy aavasthy marked this pull request as ready for review March 28, 2025 06:31
@aavasthy aavasthy added the auto-merge Enables automation to merge PRs label Mar 31, 2025
@microsoft-github-policy-service microsoft-github-policy-service Bot enabled auto-merge (squash) March 31, 2025 20:54
@microsoft-github-policy-service microsoft-github-policy-service Bot merged commit 45230b8 into master Apr 1, 2025
27 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot deleted the users/aavasthy/enable_analyzers_logging branch April 1, 2025 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants