Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tpd monitor logic #39

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pkg/liveness-checker/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (api *API) checkAddressResolver(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "address-resolver", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add address-resolver service summarry to store.")
api.logger.WithError(err).Warn("Failed to add address-resolver service summary to store.")
}
api.logger.Info("address-resolver liveness check complete.")
}
Expand Down Expand Up @@ -317,7 +317,7 @@ func (api *API) checkServiceDiscovery(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "service-discovery", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add service-discovery service summarry to store.")
api.logger.WithError(err).Warn("Failed to add service-discovery service summary to store.")
}
api.logger.Info("service-discovery liveness check complete.")
}
Expand Down Expand Up @@ -351,7 +351,7 @@ func (api *API) checkTransportDiscovery(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "transport-discovery", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add transport-discovery service summarry to store.")
api.logger.WithError(err).Warn("Failed to add transport-discovery service summary to store.")
}
api.logger.Info("transport-discovery liveness check complete.")
}
Expand Down Expand Up @@ -398,7 +398,7 @@ func (api *API) checkDMSGDiscovery(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "dmsg-discovery", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add dmsg-discovery service summarry to store.")
api.logger.WithError(err).Warn("Failed to add dmsg-discovery service summary to store.")
}
api.logger.Info("dmsg-discovery liveness check complete.")

Expand Down Expand Up @@ -428,7 +428,7 @@ func (api *API) checkDMSGServers(ctx context.Context, disc disc.APIClient, serve
serviceName := "dmsg-server:" + server.Server.Address
err := api.store.AddServiceSummary(ctx, serviceName, ss)
if err != nil {
api.logger.WithError(err).Warnf("Failed to add %v serviceName service summarry to store.", serviceName)
api.logger.WithError(err).Warnf("Failed to add %v serviceName service summary to store.", serviceName)
}
api.logger.Infof("%v liveness check complete.", serviceName)
}
Expand Down Expand Up @@ -464,7 +464,7 @@ func (api *API) checkRouteFinder(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "route-finder", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add route-finder service summarry to store.")
api.logger.WithError(err).Warn("Failed to add route-finder service summary to store.")
}
api.logger.Info("route-finder liveness check complete.")
}
Expand Down Expand Up @@ -508,7 +508,7 @@ func (api *API) checkUptimeTracker(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "uptime-tracker", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add uptime-tracker service summarry to store.")
api.logger.WithError(err).Warn("Failed to add uptime-tracker service summary to store.")
}
api.logger.Info("uptime-tracker liveness check complete.")
}
Expand Down Expand Up @@ -557,7 +557,7 @@ func (api *API) checkIPService(ctx context.Context) {

err = api.store.AddServiceSummary(ctx, "ip-service", ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add ip-service service summarry to store.")
api.logger.WithError(err).Warn("Failed to add ip-service service summary to store.")
}
api.logger.Info("ip-service liveness check complete.")
}
Expand Down Expand Up @@ -586,7 +586,7 @@ func (api *API) checkStunServers(ctx context.Context) {
serviceName := "stunserver:" + stunServer
err = api.store.AddServiceSummary(ctx, serviceName, ss)
if err != nil {
api.logger.WithError(err).Warn("Failed to add ip-service service summarry to store.")
api.logger.WithError(err).Warn("Failed to add ip-service service summary to store.")
}
api.logger.Infof("%v liveness check complete.", serviceName)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/network-monitor/store/redis_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func testNetwork(t *testing.T, store Store) {

t.Run("specific visor summary by pub key", func(t *testing.T) {
for pk, sum := range visorSumObj {
summarry, err := store.GetVisorByPk(pk.String())
summary, err := store.GetVisorByPk(pk.String())
require.NoError(t, err)
require.Equal(t, summarry, sum)
require.Equal(t, summary, sum)
}
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/network-monitor/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var (
// ErrVisorSumNotFound indicates that requested visor summary is not registered.
ErrVisorSumNotFound = errors.New("Visor summarry not found")
ErrVisorSumNotFound = errors.New("Visor summary not found")
)

// Store stores Transport metadata and generated nonce values.
Expand Down
2 changes: 1 addition & 1 deletion pkg/tpd-monitor/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func getARData(url string) (map[string]map[string]bool, error) {
}

func (api *API) tpdDeregister(tps []string) {
err := api.deregisterRequest(tps, api.dmsgURL+"/deregister", "tp discovery")
err := api.deregisterRequest(tps, api.tpdURL+"/deregister", "tp discovery")
if err != nil {
api.logger.Warn(err)
return
Expand Down
Loading