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

COCNEPT: #207 prepare concept for redisign metrics used in summary inside job response #748

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# \[Concept\] \[#207\] Redesign metrics used in summary inside Job Response

| Key | Value |
|---------------|-------------------------------------------------------------------------------|
| Creation date | 31.01.2024 |
| Ticket Id | #207 https://github.com/eclipse-tractusx/item-relationship-service/issues/207 |
| State | DRAFT |

## Table of Contents

1. [Overview](#overview)
2. [Problem Statement](#problem-statement)
3. [Concept](#concept)

## Overview
Currently summary section of a JobResponse contains information about asyncFetchedItems which covers DigitalTwin Registry requests responses and Submodel Server requests responses.
Results are shown together for both of mentioned responses:
```
"summary": {
"asyncFetchedItems": {
"completed": 1,
"failed": 0,
"running": 0
}
}
```

## Problem Statement
We would like to have separate summary response for DigitalTwin Registry requests and Submodel Server.
Also there should be information about actual tree depth for given JobResponse.

## Concept
This diagram shows current flow:
![alt text](https://eclipse-tractusx.github.io/item-relationship-service/docs/arc42/architecture-constraints/execute-job.svg)

Steps number 4 and 6 are respectively requesting AAS and Submodel. Then both are stored in BlobStore by method `addTransferProcess` in `JobStore`.
They should be distinguished by the type, so when step 12 (complete) is executed we can query the store for completed, failed and running items and add them to the response by type.
```
"summary": {
"asyncFetchedItemsRegistry": {
"running": 0,
"completed": 1,
"failed": 1
},
"asyncFetchedItemsSubmodelServer": {
"running": 0,
"completed": 1,
"failed": 1
}
},
```
Tree is stored as list of nodes in list of Relationships as filed `private List<Relationship> relationships;` in `ItemContainer`.
Tree is assebmled in class `ItemTreesAssembler` in method `retrieveItemGraph`.
We should get the depth of the tree and add it to the response. Consider using https://www.geeksforgeeks.org/depth-n-ary-tree/
Copy link

@ds-jhartmann ds-jhartmann Feb 2, 2024

Choose a reason for hiding this comment

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

Important to note that determining the depth of a running job like this is only suitable as some sort of progress bar. The actual "completion by depth" criteria still has to be evaluated in the DigitalTwinDelegate and needs to be done independently for every branch of the tree