Documentation
¶
Overview ¶
Package costserver contains the implementation of the RPCs for the fleet cost server.
Index ¶
- func InstallCron(costFrontend *FleetCostFrontend)
- func InstallServices(costFrontend fleetcostAPI.FleetCostServer, srv grpc.ServiceRegistrar)
- func MustCreateCostIndicator(ctx context.Context, f *FleetCostFrontend, ...)
- func NewFleetCostFrontend() fleetcostAPI.FleetCostServer
- func SetBQClient(costFrontend *FleetCostFrontend, client bqwrapper.BQIf)
- func SetProjectID(costFrontend *FleetCostFrontend, projectID string)
- func SetUFSClient(costFrontend *FleetCostFrontend, client ufspb.FleetClient)
- func SetUFSHostname(costFrontend *FleetCostFrontend, ufsHostname string)
- type FleetCostFrontend
- func (f *FleetCostFrontend) CreateCostIndicator(ctx context.Context, request *fleetcostAPI.CreateCostIndicatorRequest) (*fleetcostAPI.CreateCostIndicatorResponse, error)
- func (f *FleetCostFrontend) CreateVariable(ctx context.Context, request *fleetcostAPI.CreateVariableRequest) (*fleetcostAPI.CreateVariableResponse, error)
- func (f *FleetCostFrontend) DeleteCostIndicator(ctx context.Context, request *fleetcostAPI.DeleteCostIndicatorRequest) (*fleetcostAPI.DeleteCostIndicatorResponse, error)
- func (f *FleetCostFrontend) GetCostResult(ctx context.Context, req *fleetcostAPI.GetCostResultRequest) (*fleetcostModels.CostResult, error)
- func (f *FleetCostFrontend) ListCostIndicators(ctx context.Context, request *fleetcostAPI.ListCostIndicatorsRequest) (*fleetcostAPI.ListCostIndicatorsResponse, error)
- func (f *FleetCostFrontend) PersistToBigquery(ctx context.Context, request *fleetcostAPI.PersistToBigqueryRequest) (*fleetcostAPI.PersistToBigqueryResponse, error)
- func (f *FleetCostFrontend) Ping(context.Context, *fleetcostAPI.PingRequest) (*fleetcostAPI.PingResponse, error)
- func (f *FleetCostFrontend) PingUFS(ctx context.Context, _ *fleetcostAPI.PingUFSRequest) (*fleetcostAPI.PingUFSResponse, error)
- func (f *FleetCostFrontend) RepopulateCache(ctx context.Context, request *fleetcostAPI.RepopulateCacheRequest) (*fleetcostAPI.RepopulateCacheResponse, error)
- func (f *FleetCostFrontend) UpdateCostIndicator(ctx context.Context, request *fleetcostAPI.UpdateCostIndicatorRequest) (*fleetcostAPI.UpdateCostIndicatorResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallCron ¶
func InstallCron(costFrontend *FleetCostFrontend)
InstallCron installs cron jobs into the frontend.
func InstallServices ¶
func InstallServices(costFrontend fleetcostAPI.FleetCostServer, srv grpc.ServiceRegistrar)
InstallServices installs services (such as the prpc server) into the frontend.
func MustCreateCostIndicator ¶
func MustCreateCostIndicator(ctx context.Context, f *FleetCostFrontend, costIndicator *fleetcostModels.CostIndicator)
MustCreateCostIndicator is a helper function for tests that ergonomically creates a CostIndicator so that the database can be brought to a known state.
func NewFleetCostFrontend ¶
func NewFleetCostFrontend() fleetcostAPI.FleetCostServer
NewFleetCostFrontend returns a new fleet cost frontend.
func SetBQClient ¶
func SetBQClient(costFrontend *FleetCostFrontend, client bqwrapper.BQIf)
SetBQClient sets the bigquery client.
func SetProjectID ¶
func SetProjectID(costFrontend *FleetCostFrontend, projectID string)
SetProjectID records the projectID, needed for writing to BigQuery.
func SetUFSClient ¶
func SetUFSClient(costFrontend *FleetCostFrontend, client ufspb.FleetClient)
SetUFSClient sets the UFS client on a frontend.
func SetUFSHostname ¶
func SetUFSHostname(costFrontend *FleetCostFrontend, ufsHostname string)
SetUFSHostname sets the UFS hostname on the frontend.
This is used to populate debugging info in the PingUFS RPC.
Types ¶
type FleetCostFrontend ¶
type FleetCostFrontend struct {
// contains filtered or unexported fields
}
FleetCostFrontend is the fleet cost frontend.
func (*FleetCostFrontend) CreateCostIndicator ¶
func (f *FleetCostFrontend) CreateCostIndicator(ctx context.Context, request *fleetcostAPI.CreateCostIndicatorRequest) (*fleetcostAPI.CreateCostIndicatorResponse, error)
CreateCostIndicator creates a cost indicator.
func (*FleetCostFrontend) CreateVariable ¶
func (f *FleetCostFrontend) CreateVariable(ctx context.Context, request *fleetcostAPI.CreateVariableRequest) (*fleetcostAPI.CreateVariableResponse, error)
CreateVariable creates a global variable.
func (*FleetCostFrontend) DeleteCostIndicator ¶
func (f *FleetCostFrontend) DeleteCostIndicator(ctx context.Context, request *fleetcostAPI.DeleteCostIndicatorRequest) (*fleetcostAPI.DeleteCostIndicatorResponse, error)
DeleteCostIndicator deletes a CostIndicator.
func (*FleetCostFrontend) GetCostResult ¶
func (f *FleetCostFrontend) GetCostResult(ctx context.Context, req *fleetcostAPI.GetCostResultRequest) (*fleetcostModels.CostResult, error)
GetCostResult gets cost result of a fleet resource(DUT, scheduling unit).
TODO(gregorynisbet):
Include "missing entries forgiveness" disposition in the cache. We don't want strict and lax cache entries interfering with each other.
func (*FleetCostFrontend) ListCostIndicators ¶
func (f *FleetCostFrontend) ListCostIndicators(ctx context.Context, request *fleetcostAPI.ListCostIndicatorsRequest) (*fleetcostAPI.ListCostIndicatorsResponse, error)
ListCostIndicators lists the cost indicators in the database satisfying the request.
func (*FleetCostFrontend) PersistToBigquery ¶
func (f *FleetCostFrontend) PersistToBigquery(ctx context.Context, request *fleetcostAPI.PersistToBigqueryRequest) (*fleetcostAPI.PersistToBigqueryResponse, error)
PersistToBigquery persists the current cost indicators to BigQuery.
Or rather, it would, if it were implemented, which it is not.
func (*FleetCostFrontend) Ping ¶
func (f *FleetCostFrontend) Ping(context.Context, *fleetcostAPI.PingRequest) (*fleetcostAPI.PingResponse, error)
Ping takes a PingRequest which is empty and returns a PingResponse which is empty.
func (*FleetCostFrontend) PingUFS ¶
func (f *FleetCostFrontend) PingUFS(ctx context.Context, _ *fleetcostAPI.PingUFSRequest) (*fleetcostAPI.PingUFSResponse, error)
PingUFS takes a PingUFSRequest which is empty and pings UFS, returning a description of what it did.
func (*FleetCostFrontend) RepopulateCache ¶
func (f *FleetCostFrontend) RepopulateCache(ctx context.Context, request *fleetcostAPI.RepopulateCacheRequest) (*fleetcostAPI.RepopulateCacheResponse, error)
RepopulateCache repopulates the datastore cache ahead of persisting to bigquery.
func (*FleetCostFrontend) UpdateCostIndicator ¶
func (f *FleetCostFrontend) UpdateCostIndicator(ctx context.Context, request *fleetcostAPI.UpdateCostIndicatorRequest) (*fleetcostAPI.UpdateCostIndicatorResponse, error)
UpdateCostIndicator updates a CostIndicator.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package controller contains main business logic of the cost service.
|
Package controller contains main business logic of the cost service. |
Package entities contains the datastore entities and handles datestore manipulation.
|
Package entities contains the datastore entities and handles datestore manipulation. |
Package fakeufsdata contains fake UFS data to be used in tests.
|
Package fakeufsdata contains fake UFS data to be used in tests. |
inventory
|
|
ufs
Package ufs handles logical for fetching data from UFS.
|
Package ufs handles logical for fetching data from UFS. |
Package maskutils is a collection of utilities for getting, setting, validating and doing other stuff to protos like fleetcostpb.CostIndicator given a fieldmask.
|
Package maskutils is a collection of utilities for getting, setting, validating and doing other stuff to protos like fleetcostpb.CostIndicator given a fieldmask. |
Package testscenarios contains only tests.
|
Package testscenarios contains only tests. |
Package testsupport provides a text fixture that sets up unit tests for the fleet cost server.
|
Package testsupport provides a text fixture that sets up unit tests for the fleet cost server. |