-
Notifications
You must be signed in to change notification settings - Fork 492
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
Introducing TrafficController to manage TrafficGate and Pipeline #55
Conversation
Finished EaseMomitorMetrics, ready to be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me
@@ -120,7 +120,7 @@ type ( | |||
// Status is the status of Proxy. | |||
Status struct { | |||
MainPool *PoolStatus `yaml:"mainPool"` | |||
CandidatePools []*PoolStatus `yaml:"candidatePool,omitempty"` | |||
CandidatePools []*PoolStatus `yaml:"candidatePools,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter reference needs to be updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been updated already. This is a legacy typo.
namespace string | ||
// The scenario here satisfies the first common case: | ||
// When the entry for a given key is only ever written once but read many times. | ||
// Referecen: https://golang.org/pkg/sync/#Map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
// Referecen: https://golang.org/pkg/sync/#Map | |
// Reference: https://golang.org/pkg/sync/#Map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Space struct { | ||
namespace string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Space
represent a namespace? If my understanding is right, suggest change it to Namespace
Space struct { | |
namespace string | |
Namespace struct { | |
name string |
I got confused with the name StatusOneSpace
at first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
httpServer *supervisor.ObjectEntity | ||
httpPipelines map[string]*supervisor.ObjectEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems httpServer
and httpPipelines
are redundant as tc
already has all the necessary information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the original implementation, it's hard to eliminate them at once. They must be deleted at Close
and so on. I will clean all codes of MeshController in the next contribution.
} | ||
|
||
// Status is the status of RawConfigTrafficController. | ||
Status = trafficcontroller.StatusOneSpace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to easemonitormetrics.go
implementation, StatusOneSpace
seems to only be used to let HTTPServer and HTTPPiepline's status records reporting to the same metric name. (SameSpace?) Proposal to add more comments about this status or change it to a more meaningful name.(StatusSameNamespace)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
type ( | ||
// RawConfigTrafficController is a system controller to manage | ||
// TrafficGate, Pipeline and their relationship. | ||
RawConfigTrafficController struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that the difference betweenRawConfigTrafficController
and TrafficController
is only the default-namespace and mulitple-namespace? If so, proposal to remove this RawConfigTrafficController
and let TrafficController
handle the default namespace as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RawConfigTrafficController
is a must-have controller to decouple TrafficController
with the input source. It will bring more complicity and less extensibility to TrafficController
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Close #20
configSyncer
, clean it to only handle sync config.One TODO left (coming soon):
EaseMonitorMetrics
to adapt to internal changing of data structure.