instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT

This was incorrectly named "LT" for "larger than" in e5a5e0a907, but
that is against existing conventions, where "LT" means "less than".
Clarify by using "GT" for "greater than" in macro name, and add a missing
comment at the top of instr_time.h to note the macro's existence.

Reported by: Peter Smith <smithpb2250@gmail.com>
Author: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAHut%2BPut94CTpjQsqOJHdHkgJ2ZXq%2BqVSfMEcmDKLiWLW-hPfA%40mail.gmail.com
This commit is contained in:
Andres Freund 2026-02-26 10:19:23 -05:00
parent 763aaa06f0
commit 3218825271
2 changed files with 4 additions and 2 deletions

View file

@ -170,7 +170,7 @@ InstrAggNode(Instrumentation *dst, Instrumentation *add)
dst->firsttuple = add->firsttuple;
}
else if (dst->running && add->running &&
INSTR_TIME_LT(dst->firsttuple, add->firsttuple))
INSTR_TIME_GT(dst->firsttuple, add->firsttuple))
dst->firsttuple = add->firsttuple;
INSTR_TIME_ADD(dst->counter, add->counter);

View file

@ -28,6 +28,8 @@
*
* INSTR_TIME_ACCUM_DIFF(x, y, z) x += (y - z)
*
* INSTR_TIME_GT(x, y) x > y
*
* INSTR_TIME_GET_DOUBLE(t) convert t to double (in seconds)
*
* INSTR_TIME_GET_MILLISEC(t) convert t to double (in milliseconds)
@ -184,7 +186,7 @@ GetTimerFrequency(void)
#define INSTR_TIME_ACCUM_DIFF(x,y,z) \
((x).ticks += (y).ticks - (z).ticks)
#define INSTR_TIME_LT(x,y) \
#define INSTR_TIME_GT(x,y) \
((x).ticks > (y).ticks)
#define INSTR_TIME_GET_DOUBLE(t) \