list-nodes command action (#87)
* list-nodes command action * refactor stats into a package * store existing stats in redis, more refactoring * dz review: atomic load
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/protocol/utils"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/utils/stats"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -309,7 +309,7 @@ func (r *RedisRouter) statsWorker() {
|
||||
// update periodically seconds
|
||||
select {
|
||||
case <-time.After(statsUpdateInterval):
|
||||
r.currentNode.Stats.UpdatedAt = time.Now().Unix()
|
||||
stats.UpdateCurrentNodeStats(r.currentNode.Stats)
|
||||
if err := r.RegisterNode(); err != nil {
|
||||
logger.Errorw("could not update node", err, "nodeID", r.currentNode.Id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user