timing

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// DevWorkspaceStarted denotes when a workspace was first started
	DevWorkspaceStarted = "controller.devfile.io/timing.started"
	// ComponentsCreated denotes when components were created for the workspace
	ComponentsCreated = "controller.devfile.io/timing.components.created"
	// ComponentsReady denotes when components were ready for the workspace
	ComponentsReady = "controller.devfile.io/timing.components.ready"
	// RoutingCreated denotes when the devworkspacerouting was created for the workspace
	RoutingCreated = "controller.devfile.io/timing.routing.created"
	// RoutingReady denotes when the devworkspacerouting was ready for the workspace
	RoutingReady = "controller.devfile.io/timing.routing.ready"
	// DeploymentCreated denotes when the deployment was created for the workspace
	DeploymentCreated = "controller.devfile.io/timing.deployment.created"
	// DeploymentReady denotes when the deployment was ready for the workspace
	DeploymentReady = "controller.devfile.io/timing.deployment.ready"
	// DevWorkspaceReady denotes when all health checks were completed and the workspace was ready
	DevWorkspaceReady = "controller.devfile.io/timing.ready"
)

Variables

This section is empty.

Functions

func ClearAnnotations

func ClearAnnotations(workspace *dw.DevWorkspace)

ClearAnnotations removes all timing-related annotations from a DevWorkspace. It's necessary to call this before setting new times via SetTime(), as SetTime() does not overwrite existing annotations.

func IsEnabled

func IsEnabled() bool

IsEnabled returns whether storing timing info is enabled for the operator

func SetTime

func SetTime(timingInfo map[string]string, event string)

SetTime applies a given event annotation to the devworkspace with the current timestamp. No-op if timing is disabled or the annotation is already set, meaning this function can be called without additional checks.

func SummarizeStartup

func SummarizeStartup(workspace *dw.DevWorkspace)

SummarizeStartup applies aggregate annotations based off event annotations set by SetTime(). No-op if timing is disabled or if not all event annotations are present on the devworkspace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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