CLEANUP: stktable: move sample_conv_table_bytes_out_rate()

sample_conv_table_bytes_out_rate() was defined in the middle of other
stick-table sample convs without any ordering logic. Let's put it
where it belongs, right after sample_conv_table_bytes_in_rate().
This commit is contained in:
Aurelien DARRAGON 2025-01-15 21:14:48 +01:00
parent 62e42184ab
commit 9f68049cc1

View File

@ -1825,6 +1825,23 @@ static int sample_conv_table_bytes_in_rate(const struct arg *arg_p, struct sampl
return smp_fetch_bytes_in_rate(&stkctr, smp, 1);
}
/* Casts sample <smp> to the type of the table specified in arg(0), and looks
* it up into this table. Returns the data rate sent to clients in bytes/s
* if the key is present in the table, otherwise zero, so that comparisons can
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
static int smp_fetch_bytes_out_rate(struct stkctr *stkctr, struct sample *smp, int decrefcnt);
static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stkctr stkctr;
stkctr.table = arg_p[0].data.t;
stkctr_set_entry(&stkctr, smp_fetch_stksess(stkctr.table, smp, 0));
return smp_fetch_bytes_out_rate(&stkctr, smp, 1);
}
/* Casts sample <smp> to the type of the table specified in arg(0), and looks
* it up into this table. Returns the cumulated number of connections for the key
* if the key is present in the table, otherwise zero, so that comparisons can
@ -1942,23 +1959,6 @@ static int sample_conv_table_idle(const struct arg *arg_p, struct sample *smp, v
return 1;
}
/* Casts sample <smp> to the type of the table specified in arg(0), and looks
* it up into this table. Returns the data rate sent to clients in bytes/s
* if the key is present in the table, otherwise zero, so that comparisons can
* be easily performed. If the inspected parameter is not stored in the table,
* <not found> is returned.
*/
static int smp_fetch_bytes_out_rate(struct stkctr *stkctr, struct sample *smp, int decrefcnt);
static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp, void *private)
{
struct stkctr stkctr;
stkctr.table = arg_p[0].data.t;
stkctr_set_entry(&stkctr, smp_fetch_stksess(stkctr.table, smp, 0));
return smp_fetch_bytes_out_rate(&stkctr, smp, 1);
}
/* Casts sample <smp> to the type of the table specified in arg(0), and looks
* it up into this table. Returns the cumulated number of front glitches for the
* key if the key is present in the table, otherwise zero, so that comparisons