OPENSSL_LH_STATS(3SSL)

πŸ’– OPENSSL_LH_STATS β€” the LHASH statistics page, bestie edition πŸ’–

okay so this is OPENSSL_LH_STATS(3SSL), and it's all about peeking at the stats that the LHASH structure keeps about itself. it's giving very "check your own receipts" energy. let's go 🫢


✨ 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 β€” literally just LHASH statistics, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/lhash.h>
⚠️ heads up bestie: 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 β€” see 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 πŸ¦‹

so the LHASH structure records statistics about most aspects of accessing the hash table. it's literally keeping a diary πŸ“”βœ¨

  • OPENSSL_LH_stats() prints out statistics on the size of the hash table and how many entries are in it. but ngl, for historical reasons this function also outputs a bunch of additional statistics β€” and the tracking of those is no longer supported, so they're always reported as zero. zero bestie. nothing. the ghost of stats past πŸ’€
  • OPENSSL_LH_node_stats() prints the number of entries for each 'bucket' in the hash table. every bucket gets its 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'.
    • the 'load' is the average number of data items per 'bucket' in the hash table.
    • the 'actual load' is the average number of items per 'bucket', but only for buckets which contain entries.
    • so 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. iykyk 😌✨
  • 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 instead. same energy, different destination πŸŽ€
🚨 and like… these functions are deprecated and should no longer be used. periodt. don't do it. i'm telling you as your bestie πŸ’–

πŸ’œ RETURN VALUES πŸ’œ

these functions do not return values. not a single one. they're void, they're mysterious, they're not giving you anything back 🌈


πŸŽ€ 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. don't skip the locking, bestie, it's literally the whole plot πŸ™ˆ


🌸 SEE ALSO 🌸


⭐ HISTORY ⭐

these functions were deprecated in version 3.1. it's giving "we loved you but you gotta go" 😭


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 the whole page, bestie β€” version 4.0.3, dated 2026-09-29, from the OpenSSL crew. go forth, read your locks, and slay πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from