Re: Additional LWLOCK_STATS statistics

From: Andres Freund <andres(at)anarazel(dot)de>
To: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional LWLOCK_STATS statistics
Date: 2015-09-16 16:26:27
Message-ID: 20150916162627.GF2086@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2015-09-16 10:37:43 -0400, Jesper Pedersen wrote:
> #ifdef LWLOCK_STATS
> lwstats->spin_delay_count += SpinLockAcquire(&lock->mutex);
> +
> + /*
> + * We scan the list of waiters from the back in order to find
> + * out how many of the same lock type are waiting for a lock.
> + * Similar types have the potential to be groupped together.
> + *

Except for LW_WAIT_UNTIL_FREE there shouldn't be much in terms of
grouping? Can't you instead iterate and count
counter[waiter->lwWaitMode]++ or so?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2015-09-16 16:29:59 Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Previous Message Tom Lane 2015-09-16 16:10:14 Re: pltcl: sentence improvement