OPENSSL_LH_STATS(3ossl)

πŸ’– OPENSSL_LH_STATS πŸ’–

okay bestie, welcome to the OPENSSL_LH_STATS(3ossl) page β€” yes that's the manual name, it's giving "cryptic OpenSSL chapter title" but it's literally just the LHASH statistics girlies ✨


πŸ¦‹ NAME πŸ¦‹

OPENSSL_LH_stats, OPENSSL_LH_node_stats, OPENSSL_LH_node_usage_stats, OPENSSL_LH_stats_bio, OPENSSL_LH_node_stats_bio, OPENSSL_LH_node_usage_stats_bio β€” these are your LHASH statistics functions, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/lhash.h>

so here's the tea, and it's a lil sad: the following functions have been deprecated since OpenSSL 3.1, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” peep openssl_user_macros(7) for the deets:

void OPENSSL_LH_node_stats(LHASH *table, FILE *out);
void OPENSSL_LH_node_usage_stats(LHASH *table, FILE *out);

void OPENSSL_LH_node_stats_bio(LHASH *table, BIO *out);
void OPENSSL_LH_node_usage_stats_bio(LHASH *table, BIO *out);

void OPENSSL_LH_stats(LHASH *table, FILE *out);
void OPENSSL_LH_stats_bio(LHASH *table, BIO *out);

✨ DESCRIPTION ✨

The LHASH structure is out here recording statistics about, like, most aspects of accessing the hash table. it's keeping receipts πŸ“

OPENSSL_LH_stats() prints out statistics on the size of the hash table and how many entries are in it. but here's the messy part β€” for historical reasons, this function also outputs a number of additional statistics, and the tracking of those stats is no longer supported and they're always reported as zero. so like... zero, zero, zero, bye πŸ’€

OPENSSL_LH_node_stats() prints the number of entries for each 'bucket' in the hash table. one bucket at a time, we love a per-bucket moment πŸͺ£

OPENSSL_LH_node_usage_stats() prints out a short summary of the state of the hash table. it prints the 'load' and the 'actual load'. so the 'load' is the average number of data items per 'bucket' in the hash table. and the 'actual load' is the average number of items per 'bucket', but only for buckets which contain entries. so basically β€” the 'actual load' is the average number of searches that will need to find an item in the hash table, while the 'load' is the average number that will be done to record a miss. it's giving "found it" vs "not found bestie, keep scrolling" 😭

OPENSSL_LH_stats_bio(), OPENSSL_LH_node_stats_bio() and OPENSSL_LH_node_usage_stats_bio() are the same as the above, except that the output goes to a BIO. same vibe, different output door πŸšͺ✨

and the final word: these functions are deprecated and should no longer be used. periodt. don't do it 🚫

🫢 RETURN VALUES 🫢

these functions do not return values. they just do their lil thing and dip πŸ™ˆ


πŸŽ€ NOTE πŸŽ€

these calls should be made under a read lock. refer to "NOTE" in OPENSSL_LH_COMPFUNC(3) for more details about the locks required when using the LHASH data structure. lock it up, protect your peace πŸ”’


πŸ‘‘ SEE ALSO πŸ‘‘

bio(7), OPENSSL_LH_COMPFUNC(3) β€” go read those too, iykyk πŸ“š


🌈 HISTORY 🌈

these functions were deprecated in version 3.1. that's the lore πŸ•°οΈ


Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's a wrap, my love πŸ’– this was 3.5.9, dated 2026-09-29, straight from the OPENSSL_LH_STATS(3ossl) page β€” go forth and read your locks before you peek at the buckets, mwah 🧚🌸

πŸ“¦ where this page comes from