ControlSystemStudio / phoebus

A framework and set of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
http://phoebus.org/
Eclipse Public License 1.0
89 stars 87 forks source link

Olog client: search using keyword "includeevents" doesn't work #2988

Open konrad-gajewski opened 5 months ago

konrad-gajewski commented 5 months ago

I have created a log entry containing the "events" data. I can see the correct event data coming from olog server using its REST API.

konrad@freia-olog:/etc/apache2$ curl https://olog.site:8181/Olog/logs/67 |python3 -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1199    0  1199    0     0  16581      0 --:--:-- --:--:-- --:--:-- 16652
{
    "id": 67,
    "owner": "konrad",
    "source": "New entry using Olog/logs/multipart without any attachments.\nDefined events entry with instant=1679496701000 (March 22, 2023 3:51:41 PM)",
    "description": "New entry using Olog/logs/multipart without any attachments.\nDefined events entry with instant=1679496701000 (March 22, 2023 3:51:41 PM)",
    "title": "test2.py",
    "level": "INFO",
    "state": "Active",
    "createdDate": 1711124811074,
    "modifyDate": 1711355036345,
    "events": [
        {
            "name": "OriginalCreatedDate",
            "instant": 1679496701000
        }
    ],
    "logbooks": [
        {
            "name": "test",
            "owner": null,
            "state": "Active"
        }
    ],
    "tags": [],
    "properties": [],
    "attachments": []
}

The search done in using olog's REST API

curl "https://olog.site:8181/Olog/logs/search?start=2023-03-01&end=2023-03-30&includeevents"

works fine but the same search done in Phoebus doesn't return any entry. Is this search keyword not implemented yet or is it a bug?

georgweiss commented 5 months ago

Correct, includeevents is currently not supported in the Phoebus client. How did you add it to the log entry?

konrad-gajewski commented 5 months ago

By a simple python test program. I've started to work on migrate our old logbooks to Olog and consider different alternatives how to do it. One possibility would be to set the events' instant time to the the original creation date of the old logbook entry. In this way I would skip the need to modify the REST API to allow set createdDate value and still could use the time condition for the searches.

georgweiss commented 5 months ago

I see, but neither the Phoebus client nor the web client consider the events portion. There is no UI for that. Also note that with recently added feature to update a log entry depends on the create date and last modified date being used "correctly".

konrad-gajewski commented 5 months ago

Yes, I noticed that web client doesn't support it ether. What do you mean by "correctly"? My possible scenario would be to create a new log entry in Olog for each old entry in the current logbook (all entries in Olog would have almost the same createdDate and event with instant corresponding to the creation date in the old logbook). Even though our current logbook has the edit history we plan to move only the latest version, so the edit feature in Olog will not be used (at least not at the time of migration). Is something "incorrect" in the above scenario?

georgweiss commented 5 months ago

As long as you set the create date and last modify date to the same value, you're good. The "correct" reference is about not relying on the events data as it is not considered by the client.

konrad-gajewski commented 5 months ago

Are there any plans in the nearest future (let say 6 months) to add search support for the events in Phoebus and web clients?

georgweiss commented 5 months ago

Not in the short term, probably not in the 6 months perspective either. @shroffk, any other opinion?

shroffk commented 2 months ago

While the clients don't have a way to adding "events", I think we should update the clients default search to include events by default