Documentation
¶
Overview ¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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 © 2021 Iter8 authors ¶
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
- Variables
- func ExecTemplate(t executable, exp *Experiment) error
- func Execute()
- func Generate(values []string) (result *bytes.Buffer, err error)
- func NewAssertCmd() *cobra.Command
- func NewReportCmd() *cobra.Command
- func NewRunCmd() *cobra.Command
- func ParseValues(values []string, v chartutil.Values) error
- func RegisterHTMLTemplate(name string, tpl *ht.Template)
- func RegisterTextTemplate(name string, tpl *template.Template)
- func RenderGoTpl(v chartutil.Values, filePath string) (*bytes.Buffer, error)
- func RenderTpl(k8sExp k8sExperiment, filePath string) (*bytes.Buffer, error)
- func ResultFromBytes(b []byte) (*base.ExperimentResult, error)
- func SpecFromBytes(b []byte) ([]base.TaskSpec, error)
- type AssertOptionsType
- type ExpIO
- type Experiment
- func (exp *Experiment) Assert(conditions []string, to time.Duration) (bool, error)
- func (exp *Experiment) Completed() bool
- func (e *Experiment) ContainsInsight(in base.InsightType) bool
- func (e *Experiment) HTMLHistCharts() string
- func (e *Experiment) HTMLHistData() string
- func (e *Experiment) HTMLHistMetricsSection() string
- func (e *Experiment) HTMLMetricsSection() string
- func (e *Experiment) HTMLSLOSection() string
- func (e *Experiment) HTMLStatus() string
- func (e *Experiment) HistData() []histograms
- func (exp *Experiment) NoFailure() bool
- func (exp *Experiment) Report(outputFormat string) error
- func (e *Experiment) Run(expio ExpIO) error
- type FileExpIO
- type GenOptionsType
- type ReportOptionsType
Constants ¶
const ( Completed = "completed" NoFailure = "nofailure" SLOs = "slos" SLOsByPrefix = "slosby" )
const ( // TextOutputFormat is the output format used to create text output TextOutputFormatKey = "text" // HTMLOutputFormat is the output format used to create html output HTMLOutputFormatKey = "html" )
const (
Iter8Hub = "github.com/iter8-tools/iter8.git//hub"
)
Variables ¶
var AssertOptions = AssertOptionsType{}
var GenOptions = GenOptionsType{}
var ReportOptions = ReportOptionsType{ OutputFormat: TextOutputFormatKey, }
var RootCmd = &cobra.Command{
Use: "iter8",
Short: "Metrics driven experiments",
Long: globalUsage,
Version: "v0.8",
}
RootCmd represents the base command when called without any subcommands
Functions ¶
func ExecTemplate ¶
func ExecTemplate(t executable, exp *Experiment) error
execute text or html template with experiment
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func NewAssertCmd ¶
NewAssertCmd creates an assert command with the assert flagset
func RegisterHTMLTemplate ¶
RegisterHTMLTemplate registers an HTML template
func RegisterTextTemplate ¶
RegisterTextTemplate registers a text template
func RenderGoTpl ¶
RenderGoTpl creates output from go.tpl
func ResultFromBytes ¶
func ResultFromBytes(b []byte) (*base.ExperimentResult, error)
ResultFromBytes reads experiment result from bytes
Types ¶
type AssertOptionsType ¶
type ExpIO ¶
type ExpIO interface { ReadSpec() ([]base.TaskSpec, error) ReadResult() (*base.ExperimentResult, error) WriteResult(r *Experiment) error }
type Experiment ¶
type Experiment struct { *base.Experiment // contains filtered or unexported fields }
func (*Experiment) Completed ¶
func (exp *Experiment) Completed() bool
Completed returns true if the experiment is complete if the result stanza is missing, this function returns false
func (*Experiment) ContainsInsight ¶
func (e *Experiment) ContainsInsight(in base.InsightType) bool
ContainsInsight checks if the experiment contains insight
func (*Experiment) HTMLHistCharts ¶
func (e *Experiment) HTMLHistCharts() string
HTMLHistCharts returns histogram charts section in HTML report
func (*Experiment) HTMLHistData ¶
func (e *Experiment) HTMLHistData() string
HTMLHistData returns histogram data section in HTML report
func (*Experiment) HTMLHistMetricsSection ¶
func (e *Experiment) HTMLHistMetricsSection() string
HTMLHistMetricsSection prints histogram metrics in the HTML report
func (*Experiment) HTMLMetricsSection ¶
func (e *Experiment) HTMLMetricsSection() string
HTMLMetricsSection prints metrics in the HTML report
func (*Experiment) HTMLSLOSection ¶
func (e *Experiment) HTMLSLOSection() string
HTMLSLOSection prints the SLO section in HTML report
func (*Experiment) HTMLStatus ¶
func (e *Experiment) HTMLStatus() string
HTMLStatus prints the current state of the experiment
func (*Experiment) HistData ¶
func (e *Experiment) HistData() []histograms
HistData provides histogram data for all histogram metrics
func (*Experiment) NoFailure ¶
func (exp *Experiment) NoFailure() bool
NoFailure returns true if no task int he experiment has failed if the result stanza is missing, this function returns false
func (*Experiment) Report ¶
func (exp *Experiment) Report(outputFormat string) error
Report creates a report from experiment as per outputFormat
type FileExpIO ¶
type FileExpIO struct{}
FileExpIO enables reading and writing through files
func (*FileExpIO) ReadResult ¶
func (f *FileExpIO) ReadResult() (*base.ExperimentResult, error)
read experiment result from file
func (*FileExpIO) WriteResult ¶
func (f *FileExpIO) WriteResult(r *Experiment) error
write experiment result to file
type GenOptionsType ¶
type GenOptionsType struct { // Values are user specified values used during gen Values []string }
type ReportOptionsType ¶
type ReportOptionsType struct { // Output format variable holds the output format to be used by gen OutputFormat string }