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

trace system up is up per tenant for cloud #1098

Merged
merged 4 commits into from
Jul 10, 2023
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
24 changes: 24 additions & 0 deletions server/memphis_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -1886,3 +1886,27 @@ func getStationReplicas(replicas int) int {
func getDefaultReplicas() int {
return 1
}

func updateSystemLiveness() {
stationsHandler := StationsHandler{S: serv}
stations, totalMessages, totalDlsMsgs, err := stationsHandler.GetAllStationsDetails(false, "")
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

producersCount, err := db.CountAllActiveProudcers()
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

consumersCount, err := db.CountAllActiveConsumers()
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

analyticsParams := map[string]interface{}{"total-messages": strconv.Itoa(int(totalMessages)), "total-dls-messages": strconv.Itoa(int(totalDlsMsgs)), "total-stations": strconv.Itoa(len(stations)), "active-producers": strconv.Itoa(int(producersCount)), "active-consumers": strconv.Itoa(int(consumersCount))}
analytics.SendEvent("", "", analyticsParams, "system-is-up")
}
26 changes: 0 additions & 26 deletions server/memphis_zombie_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ package server

import (
"encoding/json"
"memphis/analytics"
"memphis/db"
"memphis/models"
"strconv"
"sync"
"time"
)
Expand Down Expand Up @@ -45,30 +43,6 @@ func (srv *Server) removeStaleStations() {
}
}

func updateSystemLiveness() {
stationsHandler := StationsHandler{S: serv}
stations, totalMessages, totalDlsMsgs, err := stationsHandler.GetAllStationsDetails(false, "")
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

producersCount, err := db.CountAllActiveProudcers()
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

consumersCount, err := db.CountAllActiveConsumers()
if err != nil {
serv.Warnf("updateSystemLiveness: %v", err.Error())
return
}

analyticsParams := map[string]interface{}{"total-messages": strconv.Itoa(int(totalMessages)), "total-dls-messages": strconv.Itoa(int(totalDlsMsgs)), "total-stations": strconv.Itoa(len(stations)), "active-producers": strconv.Itoa(int(producersCount)), "active-consumers": strconv.Itoa(int(consumersCount))}
analytics.SendEvent("", "", analyticsParams, "system-is-up")
}

func aggregateClientConnections(s *Server) (map[string]string, error) {
connectionIds := make(map[string]string)
var lock sync.Mutex
Expand Down