Skip to content

Commit

Permalink
refactor: use resource watches on dashboard
Browse files Browse the repository at this point in the history
Instead of doing excessive get/list requests, do a watch per node in an infinite retry.

Additionally, refactor the dashboard code to make the various data listener namings more consistent and reorganize the packages.

Closes #6960.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Mar 17, 2023
1 parent 9933ebb commit 2dd0964
Show file tree
Hide file tree
Showing 22 changed files with 906 additions and 493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Package datasource implements data sources for the dashboards.
package datasource
// Package apidata implements the types and the data sources for the data sourced from various Talos APIs.
package apidata
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Package data implements types to handle monitoring data, calculate values from it, etc.
package data
// Package apidata implements types to handle monitoring data, calculate values from it, etc.
package apidata

import (
"time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

package data
package apidata

import "github.com/siderolabs/talos/pkg/machinery/api/machine"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

package data
package apidata

import (
"github.com/siderolabs/gen/slices"

"github.com/siderolabs/talos/pkg/machinery/api/machine"
"github.com/siderolabs/talos/pkg/machinery/resources/cluster"
"github.com/siderolabs/talos/pkg/machinery/resources/config"
"github.com/siderolabs/talos/pkg/machinery/resources/hardware"
"github.com/siderolabs/talos/pkg/machinery/resources/k8s"
"github.com/siderolabs/talos/pkg/machinery/resources/network"
"github.com/siderolabs/talos/pkg/machinery/resources/runtime"
)

// Node represents data gathered from a single node.
Expand All @@ -38,18 +32,6 @@ type Node struct {

// Time-series data.
Series map[string][]float64

MachineStatus *runtime.MachineStatus
MachineType *config.MachineType
KubeletSpec *k8s.KubeletSpec
ResolverStatus *network.ResolverStatus
TimeServerStatus *network.TimeServerStatus
SystemInformation *hardware.SystemInformation
ClusterInfo *cluster.Info
StaticPodStatuses []*k8s.StaticPodStatus
RouteStatuses []*network.RouteStatus
LinkStatuses []*network.LinkStatus
Members []*cluster.Member
}

// MemUsage as used/total.
Expand Down

0 comments on commit 2dd0964

Please sign in to comment.