4 Commits
Author SHA1 Message Date
Chris F Ravenscroft a2c151b0d0 fix: remove spinlock in monitoring code (#405) 2024-02-18 17:21:52 -08:00
Chris F Ravenscroft 67d77324a3 chore: reweure ldap packages (#370) 2023-12-10 15:32:24 -08:00
Alessandro Cabbia 94fe62cfe1 monitoring: metrics enhancements and proposal for dropping expvar (#351)
* feat: introduce new prometheus monitor object

* feat: add LDAPMonitorWatcher as a potential replacement for v0 Collector

* feat: pass monitor object as dependency and instrument core operations

* feat: instantiate monitor in main

* ci: exclude mock files

* ci: generate mocks before running tests and go vet

* ci: make vet command keep going in case of errors

reason is due to the following happening in the GetStats method of the ldap.Stats struct

```
internal/monitoring/mock_interfaces.go:92:13: assignment copies lock value to ret0: (github.com/nmcclain/ldap.Stats, bool) contains github.com/nmcclain/ldap.Stats contains sync.Mutex
internal/monitoring/mock_interfaces.go:93:9: return copies lock value: github.com/nmcclain/ldap.Stats contains sync.Mutex
internal/monitoring/ldap_test.go:23:56: call of mockLDAPServer.EXPECT().GetStats().MinTimes(1).Return copies lock value: github.com/nmcclain/ldap.Stats contains sync.Mutex
```

* deps:  move to use go.uber.org/mock/gomock
2023-10-21 11:58:12 -07:00
Alessandro Cabbia accf15410c refactor: separating http handlers from routing setup (#350)
* fix: offload prometheus logic to the monitoring package

* fix: offload ui logic to the asset package

* refactor: use handlers coming from assets and monitoring package

* ci: add unit test run and vet command

* fix: make vet happy and adjust code
2023-10-14 11:19:58 -07:00