Uninett / zino

Zino 2.0 - Network state monitor for research networks
Apache License 2.0
3 stars 4 forks source link

Add lastevent attribute to events #200

Closed johannaengland closed 3 months ago

johannaengland commented 3 months ago

Closes #198.

github-actions[bot] commented 3 months ago

Test results

    3 files      3 suites   32s :stopwatch: 290 tests 290 :heavy_check_mark: 0 :zzz: 0 :x: 870 runs  868 :heavy_check_mark: 2 :zzz: 0 :x:

Results for commit 935a0ffd.

:recycle: This comment has been updated with latest results.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.82%. Comparing base (75f276d) to head (935a0ff).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #200 +/- ## ======================================= Coverage 98.82% 98.82% ======================================= Files 40 40 Lines 5423 5426 +3 ======================================= + Hits 5359 5362 +3 Misses 64 64 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stveit commented 3 months ago

Should this maybe be added as a field to the base Event class? In the statedump I have it shows BFDEvent and AlarmEvent also have this field

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

lunkwill42 commented 3 months ago

@johannaengland @stveit I would just like to note that the original Zino 1 does not seem to put the exact same message in lastevent as it actually puts in the event log.

Example from the BGP code:

    setEventAttr $eid "lastevent" "peer was reset (now up)"

    set s [format "%s peer %s AS %s was reset (now up)" \
           $r $remote $remote_as $a_state]
    log $s
    eventLog $eid $s
johannaengland commented 3 months ago

@johannaengland @stveit I would just like to note that the original Zino 1 does not seem to put the exact same message in lastevent as it actually puts in the event log.

Example from the BGP code:

    setEventAttr $eid "lastevent" "peer was reset (now up)"

    set s [format "%s peer %s AS %s was reset (now up)" \
         $r $remote $remote_as $a_state]
    log $s
    eventLog $eid $s

That is true. I did exactly copy it how it is in Zino 1 for BFD and JuniperAlarm events. Should I change it in BGP as well?

lunkwill42 commented 3 months ago

That is true. I did exactly copy it how it is in Zino 1 for BFD and JuniperAlarm events. Should I change it in BGP as well?

Please do - it's probably best to keep all output more or less the same as the original until we're asked to do it differently :)

johannaengland commented 3 months ago

I don't know if I was sleeping yesterday, but I checked again today and the BGP task actually sets lastevent to the same values as Zino1 does. So all is well :)