lxd-benchmark/benchmark/report.go
func (r *CSVReport) AddRecord(label string, elapsed time.Duration) error {
	if len(r.records) == 0 {
		r.addRecord(csvFields)
	}

	record := []string{
		fmt.Sprintf("%d", time.Now().UnixNano()/int64(time.Millisecond)), // timestamp
		fmt.Sprintf("%d", elapsed/time.Millisecond),
		label,
		"",     // responseCode is not used
		"true", // success"
	}
	return r.addRecord(record)
}
func (r *CSVReport) AddRecord(label string, elapsed time.Duration) error {
	if len(r.records) == 0 {
		r.addRecord(csvFields)
	}

	record := []string{
		fmt.Sprintf("%d", time.Now().UnixNano()/int64(time.Millisecond)), // timestamp
		fmt.Sprintf("%d", elapsed/time.Millisecond),
		label,
		"",     // responseCode is not used
		"true", // success"
	}
	return r.addRecord(record)
}
func ( r * CSVReport ) AddRecord ( label string , elapsed time . Duration ) error { if len ( r . records ) == 0 { r . addRecord ( csvFields ) } record := [ ] string { fmt . Sprintf ( " " , time . Now ( ) . UnixNano ( ) / int64 ( time . Millisecond ) ) , // timestamp fmt . Sprintf ( " " , elapsed / time . Millisecond ) , label , " " , // responseCode is not used " " , // success" } return r . addRecord ( record ) }
// AddRecord adds a record to the report.
AddRecord adds a record to the report .