vectorgrp / sil-kit

Vector SIL Kit – Open-Source Library for Connecting Software-in-the-Loop Environments
https://vectorgrp.github.io/sil-kit-docs
MIT License
107 stars 32 forks source link

metrics: experimental internal metrics #85

Closed VDanielEdwards closed 3 months ago

VDanielEdwards commented 3 months ago

Issue: SILKIT-1379

Subject

Creation, collection, sending, receiving, and storing various metrics as JSON.

The metrics can be used to get insights into internal behavior of individual SIL Kit participants or simulations.

Currently available metrics:

If metrics are sent to remote participants, the participant that collects these, should be started first. The registry also supports collection of remote metrics, which is preferable, since it must be started first anyway.

Collection and storage of the metrics is configured via the participant configuration file (or the registry configuration file).

Metrics are only sent if they have changed.

Description

Instructions for review / testing

Developer checklist (address before review)

VDanielEdwards commented 3 months ago

@KonradBkd @MariusBgm ~I'll rebase onto main to get the much much cleaner formatting of the traits header, if you don't mind. I'm going to do that if both of you give this comment a thumbs-up reaction.~

Rebased onto main. Thank you!

VDanielEdwards commented 3 months ago

Does it ever make sense to have a Remote sink and CollectFromRemote: True on the same participant? I managed to get a kind of recursion with the setup:

P1:

Experimental:
  Metrics:
    Sinks:
      - Type: Remote
    CollectFromRemote: True

P2:

Experimental:
  Metrics:
    Sinks:
      - Type: JsonFile
        Name: PartMetricsLogRemotes
    CollectFromRemote: True

Fixed and added a test that ensures that such configs are not accepted.