You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the MetricType interface represents each calculated metric. If we want to calculate a new metric, we need a new class implementing the MetricType interface. However, the issue arises because this class contains metadata for each metric (such as name, category, feature, etc.) along with the code to calculate the metric's current value. This violates the Single Responsibility Principle.
The problem with this approach is evident when we look at the subclass, APiMetricType, which mixes metadata information with calculation logic. For instance, there's a method within this subclass specifically for calculating the unique hits for an endpoint.
Presently, when we store a hit in the temporary table, we save the MetricType for it. However, this value gets calculated even when we're not taking a metric snapshot at that moment.
Hit the http://localhost:8082/api/v1/telemetry/stats Endpoint Again, check that all the IMAGE_API Metric are 0 are still 0, on this point we already must have some values there
Also:
Run the follow query on the Database
select * from metrics_temp
Check the metric_type on any register, this is a JSON and you are going to see that this had a unique attribute
{ "description":"Count of '/dA/' API calls From Back End", "feature":"IMAGE_API", "name":"COUNT_OF_BE_DA_CALLS", "category":"DIFFERENTIATING_FEATURES" }
Acceptance Criteria
Split the MetricType Interface on 2 Interface one to set the Metadata and the other one to set the calculation code .
dotCMS Version
latest in Telemetry Plugin main branch
Proposed Objective
Core Features
Proposed Priority
Priority 2 - Important
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
The text was updated successfully, but these errors were encountered:
Parent Issue
No response
Problem Statement
Currently, the MetricType interface represents each calculated metric. If we want to calculate a new metric, we need a new class implementing the MetricType interface. However, the issue arises because this class contains metadata for each metric (such as name, category, feature, etc.) along with the code to calculate the metric's current value. This violates the Single Responsibility Principle.
The problem with this approach is evident when we look at the subclass, APiMetricType, which mixes metadata information with calculation logic. For instance, there's a method within this subclass specifically for calculating the unique hits for an endpoint.
Presently, when we store a hit in the temporary table, we save the MetricType for it. However, this value gets calculated even when we're not taking a metric snapshot at that moment.
Steps to Reproduce
Also:
select * from metrics_temp
Check the metric_type on any register, this is a JSON and you are going to see that this had a unique attribute
{ "description":"Count of '/dA/' API calls From Back End", "feature":"IMAGE_API", "name":"COUNT_OF_BE_DA_CALLS", "category":"DIFFERENTIATING_FEATURES" }
Acceptance Criteria
Split the MetricType Interface on 2 Interface one to set the Metadata and the other one to set the calculation code .
dotCMS Version
latest in Telemetry Plugin main branch
Proposed Objective
Core Features
Proposed Priority
Priority 2 - Important
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
The text was updated successfully, but these errors were encountered: