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

Refactor Measure and MeasureResult class in model and agent #87

Closed
lsulak opened this issue Oct 16, 2023 · 0 comments · Fixed by #89
Closed

Refactor Measure and MeasureResult class in model and agent #87

lsulak opened this issue Oct 16, 2023 · 0 comments · Fixed by #89
Assignees
Labels
Agent Issues touching the agent part of the project enhancement New feature or request Model Changes to the data model this project uses (DTO or internal to Agent/Server)

Comments

@lsulak
Copy link
Collaborator

lsulak commented Oct 16, 2023

Background

Currently the implementation of MeasureResult is only on the model side, and does not carry type information. Also, it's not used in Agent - we need to somehow connect those two modules.

Feature

Improve the current MeasureResult class so that it carries information about type and also add support for having additional metadata / helper measures used - it can be an empty Map for now.

Also add a mapping between these DTO objects and internal types in the Agent - feel free to use MeasuresMapper for this, it might be what we need here.

Proposed Solution

case class MeasureResultDTO(
                           mainValue: TypedValue,
                           supportValues: Map[String, TypedValue] = Map.empty
                           )


object MeasureResultDTO {
  case class TypedValue(
                         value: String,
                         valueType: String //actually enumaration, but those can cause issues in in serde
                       )
}


//count -> MeasureResultDTO in JSON format
//"mainValue": {
//  "value": "103312",
//  "valueType": "Long"
//}
//"supportValues": {}


//avg -> MeasureResultDTO in JSON format
//"mainValue": {
//  "value": "2.5",
//  "valueType": "BigDecimal"
//}
//"supportValues": {
//   "count": {
//     "value": "2",
//      "valueType": "Long"
//    }
//   "total": {
//     "value": "5",
//      "valueType": "BigDecimal"
//    }
// }

.addLongMeasure("count", 103312)
@lsulak lsulak added the enhancement New feature or request label Oct 16, 2023
@lsulak lsulak added Agent Issues touching the agent part of the project Model Changes to the data model this project uses (DTO or internal to Agent/Server) labels Oct 16, 2023
@lsulak lsulak added this to the MVP: Atum agent milestone Oct 16, 2023
@lsulak lsulak moved this from 🆕 To groom to 🔖 Sprint in CPS small repos project Oct 16, 2023
@lsulak lsulak moved this from 🔖 Sprint to 🏗 In progress in CPS small repos project Oct 16, 2023
salamonpavel added a commit that referenced this issue Oct 17, 2023
salamonpavel added a commit that referenced this issue Oct 17, 2023
salamonpavel added a commit that referenced this issue Oct 17, 2023
salamonpavel added a commit that referenced this issue Oct 17, 2023
#89)

#87: DTOs for measures and measure results, MeasurementBuilder
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in CPS small repos project Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agent Issues touching the agent part of the project enhancement New feature or request Model Changes to the data model this project uses (DTO or internal to Agent/Server)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants