Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
chore: minor corrections (documentation and comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
puffitos committed Mar 30, 2023
1 parent 87ac634 commit ff09166
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mesh/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ func (m *Mesh) Rtt() {
// RTT without handshake
rtt := rttEnd.Sub(rttStart)

// safe metrics
// save metrics
m.metrics.GetRtt().WithLabelValues(data.SampleName[data.RTT_TOTAL], node.Name).Observe(rttH.Seconds())
m.metrics.GetRtt().WithLabelValues(data.SampleName[data.RTT_REQUEST], node.Name).Observe(rtt.Seconds())

// safe samples
// save samples
m.database.SetSample(
&data.Sample{
From: m.setupConfig.Name,
Expand Down
6 changes: 3 additions & 3 deletions mesh/mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"go.uber.org/zap"
)

// Main struct for the mesh
// Mesh is the internal mesh representation
type Mesh struct {
// Mesh in-memory datastore
database data.Database
Expand Down Expand Up @@ -70,13 +70,13 @@ type Mesh struct {
joinRoutineDone bool
}

// A newly discoverd node in the mesh
// NodeDiscovered represents a newly discovered node in the mesh
type NodeDiscovered struct {
NewNode *meshv1.Node
From uint32 // TODO change to name
}

// Create a canary bot & mesh with the desired configuration
// CreateCanaryMesh creates a canary bot & mesh with the desired configuration
// Use a pre-defined routineConfig with e.g. StandardProductionRoutineConfig()
// and define your mesh setup configuration
//
Expand Down
4 changes: 2 additions & 2 deletions mesh/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
)

// Mesh server for incomming requests
// MeshServer for incoming requests
type MeshServer struct {
meshv1.UnimplementedMeshServiceServer
metrics metric.Metrics
Expand All @@ -51,7 +51,7 @@ type MeshServer struct {
newNodeDiscovered chan NodeDiscovered
}

// RPC if node wants to join the mesh
// JoinMesh allows a node to join the mesh
func (s *MeshServer) JoinMesh(ctx context.Context, req *meshv1.Node) (*meshv1.JoinMeshResponse, error) {
s.log.Infow("New join mesh request", "node", req.Name)
// Check if name of joining node is unique in mesh, let join if state is not ok, let join if target is same
Expand Down

0 comments on commit ff09166

Please sign in to comment.