(b *testing.B)
| 47 | } |
| 48 | |
| 49 | func (ent *Ent) Insert(b *testing.B) { |
| 50 | m := NewModelAlt() |
| 51 | |
| 52 | b.ReportAllocs() |
| 53 | b.ResetTimer() |
| 54 | |
| 55 | for i := 0; i < b.N; i++ { |
| 56 | _, err := ent.conn.Model.Create(). |
| 57 | SetName(m.Name). |
| 58 | SetTitle(m.Title). |
| 59 | SetFax(m.Fax). |
| 60 | SetWeb(m.Web). |
| 61 | SetAge(m.Age). |
| 62 | SetRight(m.Right). |
| 63 | SetCounter(m.Counter). |
| 64 | Save(ctx) |
| 65 | if err != nil { |
| 66 | helper.SetError(b, ent.Name(), "Insert", err.Error()) |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func (ent *Ent) InsertMulti(b *testing.B) { |
| 72 | ms := make([]Model, 0, 100) |
nothing calls this directly
no test coverage detected