Skip to content

Commit

Permalink
Bundle Analysis: Add to timeseries MeasurementName enum (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
JerrySentry authored May 27, 2024
1 parent 11f094a commit 3a2b240
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions graphql_api/types/enums/measurement_type.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ enum MeasurementType {
COVERAGE
FLAG_COVERAGE
COMPONENT_COVERAGE
BUNDLE_ANALYSIS_REPORT_SIZE
BUNDLE_ANALYSIS_JAVASCRIPT_SIZE
BUNDLE_ANALYSIS_STYLESHEET_SIZE
BUNDLE_ANALYSIS_FONT_SIZE
BUNDLE_ANALYSIS_IMAGE_SIZE
BUNDLE_ANALYSIS_ASSET_SIZE
}
11 changes: 10 additions & 1 deletion timeseries/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class MeasurementName(Enum):
COVERAGE = "coverage"
FLAG_COVERAGE = "flag_coverage"
COMPONENT_COVERAGE = "component_coverage"
# For tracking the entire size of a bundle report by its name
BUNDLE_ANALYSIS_REPORT_SIZE = "bundle_analysis_report_size"
# For tracking the size of a category of assets of a bundle report by its name
BUNDLE_ANALYSIS_JAVASCRIPT_SIZE = "bundle_analysis_javascript_size"
BUNDLE_ANALYSIS_STYLESHEET_SIZE = "bundle_analysis_stylesheet_size"
BUNDLE_ANALYSIS_FONT_SIZE = "bundle_analysis_font_size"
BUNDLE_ANALYSIS_IMAGE_SIZE = "bundle_analysis_image_size"
# For tracking individual asset size via its UUID
BUNDLE_ANALYSIS_ASSET_SIZE = "bundle_analysis_asset_size"


class Measurement(ExportModelOperationsMixin("timeseries.measurement"), models.Model):
Expand Down Expand Up @@ -161,7 +170,7 @@ class Meta:
),
]

def is_backfilled(self):
def is_backfilled(self) -> bool:
"""
Returns `False` for an hour after creation.
Expand Down

0 comments on commit 3a2b240

Please sign in to comment.