Documentation ¶
Overview ¶
Package metrics includes tsmon metric support.
Index ¶
- Variables
- func ReportBotConnectionTime(c context.Context, secs float64, ...)
- func ReportConnectionTime(c context.Context, secs float64, prefix, project, server, zone string)
- func ReportCreationTime(c context.Context, secs float64, prefix, project, zone string)
- func UpdateFailures(c context.Context, code int, vm *model.VM)
- func UpdateLeaks(c context.Context, leak int64, project, zone string)
- func UpdateQuota(c context.Context, limit, usage float64, metric, project, region string)
- type InstanceCount
- func (ic *InstanceCount) AddConfigured(n int, project string)
- func (ic *InstanceCount) AddConnected(n int, project, server, zone string)
- func (ic *InstanceCount) AddCreated(n int, project, zone string)
- func (ic *InstanceCount) Update(c context.Context, prefix, resourceGroup, scalingType string) error
- type TaskCount
Constants ¶
This section is empty.
Variables ¶
var ( CreatedInstanceChecked = metric.NewCounter( "gce/instance/creation/checked", "Cumulative number of GCE instances created and checked.", nil, field.String("prefix"), field.String("project"), field.String("scaling_type"), field.String("zone"), field.String("instance"), ) DestroyInstanceUnchecked = metric.NewCounter( "gce/instance/destroy/unchecked", "Cumulative number of GCE instances requested to destroy.", nil, field.String("prefix"), field.String("project"), field.String("zone"), field.String("instance"), ) )
Functions ¶
func ReportBotConnectionTime ¶
func ReportBotConnectionTime(c context.Context, secs float64, prefix, project, resourceGroup, server, zone string)
ReportBotConnectionTime sets Swarming bot connection time metric.
func ReportConnectionTime ¶
ReportConnectionTime sets GCE instance creation time metric.
func ReportCreationTime ¶
ReportCreationTime sets GCE instance creation time metric.
func UpdateFailures ¶
UpdateFailures increments failure counters.
func UpdateLeaks ¶
UpdateLeaks sets GCE instance leak metrics.
Types ¶
type InstanceCount ¶
type InstanceCount struct { // ID is the unique identifier for this count. ID string `gae:"$id"` // Prefix is the prefix for this count. Prefix string `gae:"prefix"` // ResourceGroup is the resource group for this prefix. ResourceGroup string `gae:"resource_group"` // ScalingType describe how VM current count is defined. Supported types: // - fixed: size of pool can be changed only when config changed. // - dynamic: size of pool changed over time. ScalingType string `gae:"scaling_type"` // Computed is the time this count was computed. Computed time.Time `gae:"computed"` // Configured is a slice of configuredCounts. Configured []configuredCount `gae:"configured,noindex"` // Connected is a slice of connectedCounts. Connected []connectedCount `gae:"connected,noindex"` // Created is a slice of createdCounts. Created []createdCount `gae:"created,noindex"` // contains filtered or unexported fields }
InstanceCount is a root entity representing a count for instances with a common prefix.
func (*InstanceCount) AddConfigured ¶
func (ic *InstanceCount) AddConfigured(n int, project string)
AddConfigured increments the count of configured VMs for the given project.
func (*InstanceCount) AddConnected ¶
func (ic *InstanceCount) AddConnected(n int, project, server, zone string)
AddConnected increments the count of connected VMs for the given project, server, and zone.
func (*InstanceCount) AddCreated ¶
func (ic *InstanceCount) AddCreated(n int, project, zone string)
AddCreated increments the count of created VMs for the given project and zone.
type TaskCount ¶
type TaskCount struct { // ID is the unique identifier for this count. ID string `gae:"$id"` // Queue is the task queue for this count. Queue string `gae:"queue"` // Computed is the time this count was computed. Computed time.Time `gae:"computed"` // Executing is a count of currently executing tasks. Executing int `gae:"executing,noindex"` // Total is a count of the total number of tasks in the queue. Total int `gae:"pending,noindex"` // contains filtered or unexported fields }
TaskCount is a root entity representing a count of task queue tasks.