costserver

package
v0.0.0-...-f4b31ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package costserver contains the implementation of the RPCs for the fleet cost server.

Index

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

CreateCostIndicator creates a cost indicator.

func (*FleetCostFrontend) CreateVariable

CreateVariable creates a global variable.

func (*FleetCostFrontend) DeleteCostIndicator

DeleteCostIndicator deletes a CostIndicator.

func (*FleetCostFrontend) GetCostResult

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

ListCostIndicators lists the cost indicators in the database satisfying the request.

func (*FleetCostFrontend) PersistToBigquery

PersistToBigquery persists the current cost indicators to BigQuery.

Or rather, it would, if it were implemented, which it is not.

func (*FleetCostFrontend) Ping

Ping takes a PingRequest which is empty and returns a PingResponse which is empty.

func (*FleetCostFrontend) PingUFS

PingUFS takes a PingUFSRequest which is empty and pings UFS, returning a description of what it did.

func (*FleetCostFrontend) RepopulateCache

RepopulateCache repopulates the datastore cache ahead of persisting to bigquery.

func (*FleetCostFrontend) UpdateCostIndicator

UpdateCostIndicator updates a CostIndicator.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL