Skip to content

BigScreen - Fixed retrieval of latest available QO#2081

Merged
Barthelemy merged 1 commit intoAliceO2Group:masterfrom
AliceMCH:big-screen-fixes
Jan 9, 2024
Merged

BigScreen - Fixed retrieval of latest available QO#2081
Barthelemy merged 1 commit intoAliceO2Group:masterfrom
AliceMCH:big-screen-fixes

Conversation

@aferrero2707
Copy link
Copy Markdown
Contributor

This PR fixes the retrieval of QOs when using periodic triggers. It introduces the ability to retrieve the latest available QO from the QCDB, instead of using the trigger's time stamp. The QO validity range is then compared to the time stamp of the trigger to check if the QO is recent enough to be displayed.

@aferrero2707 aferrero2707 changed the title Fixed retrieval of latest available QO BigScreen - Fixed retrieval of latest available QO Jan 5, 2024
@Barthelemy Barthelemy enabled auto-merge (squash) January 8, 2024 07:53
const auto filterMetadata = activity_helpers::asDatabaseMetadata(activity, false);
const auto objectValidity = qcdb.getLatestObjectValidity(objFullPath, filterMetadata);
if (objectValidity.isValid()) {
timestamp = objectValidity.getMax() - 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why objectValidity.getMax() - 1 in particular?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@knopers8 honestly I simply used the same logic as in the newObject trigger for the object's time stamp (see here).
If there is a better choice just let me know. Thanks!

Copy link
Copy Markdown
Collaborator

@knopers8 knopers8 Jan 9, 2024

Choose a reason for hiding this comment

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

Thanks. There, max-1 is used because it is the max timestamp that one can use to access the object. In the case of the trigger, I use it because it makes the most sense as a timestamp of data points on trending plots.

In your case, I am wondering if using "Created-At" instead of "Valid-Until" - 1 could make more sense. If we use the first, you will consider an object as too old if it was not updated recently. If you use the latter, a regularly updated object, but with no new data since some time (max validity does not move) will not be considered as too old will be considered as too old as well. Personally, I am OK with both alternatives, so I think it's up to you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the purpose of the BigScreen, I think it is useful to also identify the cases where an object is regularly updated but no new data is actually received, and show it as grey if the last new data is too far in the past. What do you think?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, indeed, this is something that shifters should be aware of.

So the algorithm would be:

  1. get the latest object validity
  2. if now - created > x, consider the object as invalid, use an appropriate colour in the display
  3. if now - validity_end > y consider the object as invalid, use an appropriate (different) colour in the display.

I would keep x and y as different parameters in case we want to tune them separately. After all, there is always some latency between the validity end and the object publication time.

Colour could be also different between the two, so it is clear which of the two cases we encounter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a very good suggestion! We can extend the logic in a separate PR, for example:

  • grey color if now - created > x (the processing is not creating new QOs)
  • yellow color if now - validity_end > y (processing creates new QOs, but from the same old data)

@Barthelemy Barthelemy merged commit bb80c29 into AliceO2Group:master Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants