Documentation ¶
Index ¶
- type GarbageCollectArgs
- type GetMetadataArgs
- type MetricProviderPlugin
- type MetricsPluginRPC
- func (g *MetricsPluginRPC) GarbageCollect(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, limit int) types.RpcError
- func (g *MetricsPluginRPC) GetMetadata(metric v1alpha1.Metric) map[string]string
- func (g *MetricsPluginRPC) InitPlugin() types.RpcError
- func (g *MetricsPluginRPC) Resume(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, ...) v1alpha1.Measurement
- func (g *MetricsPluginRPC) Run(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric) v1alpha1.Measurement
- func (g *MetricsPluginRPC) Terminate(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, ...) v1alpha1.Measurement
- func (g *MetricsPluginRPC) Type() string
- type MetricsRPCServer
- func (s *MetricsRPCServer) GarbageCollect(args any, resp *types.RpcError) error
- func (s *MetricsRPCServer) GetMetadata(args any, resp *map[string]string) error
- func (s *MetricsRPCServer) InitPlugin(args any, resp *types.RpcError) error
- func (s *MetricsRPCServer) Resume(args any, resp *v1alpha1.Measurement) error
- func (s *MetricsRPCServer) Run(args any, resp *v1alpha1.Measurement) error
- func (s *MetricsRPCServer) Terminate(args any, resp *v1alpha1.Measurement) error
- func (s *MetricsRPCServer) Type(args any, resp *string) error
- type RpcMetricProviderPlugin
- type RunArgs
- type TerminateAndResumeArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GarbageCollectArgs ¶
type GarbageCollectArgs struct { AnalysisRun *v1alpha1.AnalysisRun Metric v1alpha1.Metric Limit int }
type GetMetadataArgs ¶
type MetricProviderPlugin ¶
type MetricProviderPlugin interface { InitPlugin() types.RpcError types.RpcMetricProvider }
MetricProviderPlugin is the interface that we're exposing as a plugin. It needs to match metricproviders.Providers but we can not import that package because it would create a circular dependency.
type MetricsPluginRPC ¶
type MetricsPluginRPC struct {
// contains filtered or unexported fields
}
MetricsPluginRPC Here is an implementation that talks over RPC
func (*MetricsPluginRPC) GarbageCollect ¶
func (g *MetricsPluginRPC) GarbageCollect(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, limit int) types.RpcError
GarbageCollect is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
func (*MetricsPluginRPC) GetMetadata ¶
func (g *MetricsPluginRPC) GetMetadata(metric v1alpha1.Metric) map[string]string
GetMetadata is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
func (*MetricsPluginRPC) InitPlugin ¶
func (g *MetricsPluginRPC) InitPlugin() types.RpcError
InitPlugin is the client side function that is wrapped by a local provider this makes a rpc call to the server side function.
func (*MetricsPluginRPC) Resume ¶
func (g *MetricsPluginRPC) Resume(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement
Resume is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
func (*MetricsPluginRPC) Run ¶
func (g *MetricsPluginRPC) Run(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric) v1alpha1.Measurement
Run is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
func (*MetricsPluginRPC) Terminate ¶
func (g *MetricsPluginRPC) Terminate(analysisRun *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement
Terminate is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
func (*MetricsPluginRPC) Type ¶
func (g *MetricsPluginRPC) Type() string
Type is the client side function that is wrapped by a local provider this makes an rpc call to the server side function.
type MetricsRPCServer ¶
type MetricsRPCServer struct { // This is the real implementation Impl MetricProviderPlugin }
MetricsRPCServer Here is the RPC server that MetricsPluginRPC talks to, conforming to the requirements of net/rpc
func (*MetricsRPCServer) GarbageCollect ¶
func (s *MetricsRPCServer) GarbageCollect(args any, resp *types.RpcError) error
GarbageCollect is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
func (*MetricsRPCServer) GetMetadata ¶
func (s *MetricsRPCServer) GetMetadata(args any, resp *map[string]string) error
GetMetadata is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
func (*MetricsRPCServer) InitPlugin ¶
func (s *MetricsRPCServer) InitPlugin(args any, resp *types.RpcError) error
InitPlugin is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
func (*MetricsRPCServer) Resume ¶
func (s *MetricsRPCServer) Resume(args any, resp *v1alpha1.Measurement) error
Resume is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
func (*MetricsRPCServer) Run ¶
func (s *MetricsRPCServer) Run(args any, resp *v1alpha1.Measurement) error
Run is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
func (*MetricsRPCServer) Terminate ¶
func (s *MetricsRPCServer) Terminate(args any, resp *v1alpha1.Measurement) error
Terminate is the receiving end of the RPC call running in the plugin executable process (the server), and it calls the implementation of the plugin.
type RpcMetricProviderPlugin ¶
type RpcMetricProviderPlugin struct { // Impl Injection Impl MetricProviderPlugin }
RpcMetricProviderPlugin This is the implementation of plugin.Plugin so we can serve/consume
This has two methods: Server must return an RPC server for this plugin type. We construct a MetricsRPCServer for this.
Client must return an implementation of our interface that communicates over an RPC client. We return MetricsPluginRPC for this.
Ignore MuxBroker. That is used to create more multiplexed streams on our plugin connection and is a more advanced use case.
func (RpcMetricProviderPlugin) Client ¶
func (RpcMetricProviderPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (any, error)
func (*RpcMetricProviderPlugin) Server ¶
func (p *RpcMetricProviderPlugin) Server(*plugin.MuxBroker) (any, error)
type TerminateAndResumeArgs ¶
type TerminateAndResumeArgs struct { AnalysisRun *v1alpha1.AnalysisRun Metric v1alpha1.Metric Measurement v1alpha1.Measurement }