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

chore: Update metric length limits #46

Merged
merged 1 commit into from
Jan 31, 2024
Merged

chore: Update metric length limits #46

merged 1 commit into from
Jan 31, 2024

Conversation

just-boris
Copy link
Member

@just-boris just-boris commented Jan 29, 2024

Issue #, if available:

Description of changes:

Bring these values up to date with the receiver's end.

"Dry-run / dry-run / Components unit tests" is expected to fail. They will pass after merging cloudscape-design/components#1919 All passes now

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@just-boris just-boris requested a review from a team as a code owner January 29, 2024 17:08
@just-boris just-boris requested review from Al-Dani and removed request for a team January 29, 2024 17:08
@@ -122,43 +120,3 @@ describe('useComponentMetrics', () => {
);
});
});

describe('PanoramaClient', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted into a separate file, because this code does not have much to do with useComponentMetrics hook

console.error(`Event context for metric is too long: ${metric.eventContext}`);
return;
}
if (!validateLength(metric.eventType, 50)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added validation for all supported keys. This one is especially important, because it is shorter than others and we are likely to hit this limit

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2a6b0a1) 94.52% compared to head (34c8546) 98.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   94.52%   98.36%   +3.84%     
==========================================
  Files          16       16              
  Lines         292      306      +14     
  Branches       57       62       +5     
==========================================
+ Hits          276      301      +25     
+ Misses         16        5      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { MetricsTestHelper, Metrics } from '../metrics/metrics';
Copy link
Member Author

Choose a reason for hiding this comment

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

Tests moved from components repo: cloudscape-design/components#1919

@just-boris just-boris marked this pull request as ready for review January 29, 2024 18:23
@just-boris just-boris merged commit ea870f1 into main Jan 31, 2024
25 checks passed
@just-boris just-boris deleted the raise-limits branch January 31, 2024 17:03
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.

2 participants