storage/postgreskv: monitor calls to sql.Next

Change-Id: I32c0c92b347a6d1cadfeb69117de58f4d9b41ad2
This commit is contained in:
Jeff Wendling 2020-05-05 14:05:57 -06:00
parent 28a886f399
commit f03b23d2dc
2 changed files with 16 additions and 2 deletions

View File

@ -71,7 +71,14 @@ func (opi *orderedCockroachIterator) Next(ctx context.Context, item *storage.Lis
defer mon.Task()(&ctx)(nil)
for {
for !opi.curRows.Next() {
for {
nextTask := mon.TaskNamed("check_next_row")(nil)
next := opi.curRows.Next()
nextTask(nil)
if next {
break
}
result := func() bool {
defer mon.TaskNamed("acquire_new_query")(nil)(nil)

View File

@ -71,7 +71,14 @@ func (opi *orderedPostgresIterator) Next(ctx context.Context, item *storage.List
defer mon.Task()(&ctx)(nil)
for {
for !opi.curRows.Next() {
for {
nextTask := mon.TaskNamed("check_next_row")(nil)
next := opi.curRows.Next()
nextTask(nil)
if next {
break
}
result := func() bool {
defer mon.TaskNamed("acquire_new_query")(nil)(nil)