Documentation ¶
Index ¶
Constants ¶
View Source
const TimestampDayLayout = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostComputation ¶
type CostComputation struct { Lines []map[string]bigquery.Value ByteProcessed int64 ExecutionTime time.Duration Query string }
CostComputation is the result of running a query
type LabeledCost ¶
type LabeledCost struct { // The tag names must match those in the sql query Charges float64 `bigquery:"charges" json:"charges"` Credits float64 `bigquery:"credits" json:"credits"` ProjectName string `bigquery:"project_name" json:"project_name"` ProjectID string `bigquery:"project_id" json:"project_id"` GCPService bigquery.NullString `bigquery:"gcp_service" json:"gcp_service"` Component bigquery.NullString `bigquery:"component" json:"component,omitempty"` Service bigquery.NullString `bigquery:"service" json:"service,omitempty"` Opex bigquery.NullString `bigquery:"opex" json:"opex,omitempty"` }
LabeledCost represents a row of the cost query
func LabeledCostFrom ¶
func LabeledCostFrom(m map[string]bigquery.Value) LabeledCost
func (LabeledCost) GCPServiceMonitorLabel ¶ added in v0.2.3
func (c LabeledCost) GCPServiceMonitorLabel() string
GCPServiceMonitorLabel returns a Stackdriver friendly display label for the GCPService
type Params ¶
type Params struct { // JSON tag names must match flag option names Opex string `json:"opex,omitempty" ` DayInMonth int `json:"day" ` MonthIndex int `json:"month" ` Year int `json:"year" ` // Billing BillingTableFQN string `json:"billing-table,omitempty" ` QueryExecutionRegion string `json:"query-execution-region,omitempty" ` QueryExecutionOpex string `json:"query-execution-opex,omitempty" ` // Target TargetTableFQN string `json:"target-table,omitempty" ` TargetDatasetRegion string `json:"target-region,omitempty" ` TargetMetricsProjectID string `json:"metrics-project-id,omitempty" ` DryRun bool `json:"dryrun" ` Verbose bool `json:"v" ` }
Params captures all program flags
func ParamsFromContext ¶
func ParamsFromContext(c *cli.Context) Params
func (Params) BillingProjectID ¶
func (Params) TargetDatasetID ¶
func (Params) TargetProjectID ¶
func (Params) TargetTableID ¶
Click to show internal directories.
Click to hide internal directories.