mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add NewCondition helper in bigquery.go.
PiperOrigin-RevId: 398366805
This commit is contained in:
committed by
gVisor bot
parent
586f147cd6
commit
6b7f58b2ac
@@ -107,10 +107,7 @@ func (bm *Benchmark) AddMetric(metricName, unit string, sample float64) {
|
||||
|
||||
// AddCondition adds a condition to an existing Benchmark.
|
||||
func (bm *Benchmark) AddCondition(name, value string) {
|
||||
bm.Condition = append(bm.Condition, &Condition{
|
||||
Name: name,
|
||||
Value: value,
|
||||
})
|
||||
bm.Condition = append(bm.Condition, NewCondition(name, value))
|
||||
}
|
||||
|
||||
// NewBenchmark initializes a new benchmark.
|
||||
@@ -136,6 +133,14 @@ type Condition struct {
|
||||
Value string `bq:"value"`
|
||||
}
|
||||
|
||||
// NewCondition returns a new Condition with the given name and value.
|
||||
func NewCondition(name, value string) *Condition {
|
||||
return &Condition{
|
||||
Name: name,
|
||||
Value: value,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Condition) String() string {
|
||||
return fmt.Sprintf("Condition:\nName: %s Value: %s\n", c.Name, c.Value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user