Monado OpenXR Runtime
u_live_stats_ns Struct Reference

Struct to do live statistic tracking and printing of nano-seconds values, used by amongst other the compositor pacing code. More...

#include <util/u_live_stats.h>

Collaboration diagram for u_live_stats_ns:

Public Member Functions

void u_ls_ns_get_and_reset (struct u_live_stats_ns *uls, uint64_t *out_median, uint64_t *out_mean, uint64_t *out_worst)
 Get the median, mean and worst of the current set of values, then reset the struct. More...
 
void u_ls_ns_print_header (u_pp_delegate_t dg)
 Prints a header that looks nice before u_ls_ns_print_and_reset, adding details about columns. More...
 
void u_ls_ns_print_and_reset (struct u_live_stats_ns *uls, u_pp_delegate_t dg)
 Prints the calculated values and resets the struct, can be used with u_ls_ns_print_header to get a nice header to the values. More...
 

Static Public Member Functions

static bool u_ls_ns_add (struct u_live_stats_ns *uls, uint64_t value)
 Add a value to the live stats struct, returns true if the struct is full either before or after adding the value. More...
 

Data Fields

char name [(16)]
 Small name used for printing. More...
 
uint32_t value_count
 Number of values currently in struct. More...
 
uint64_t values [(1024)]
 The values that will be used to calculate statistics. More...
 

Detailed Description

Struct to do live statistic tracking and printing of nano-seconds values, used by amongst other the compositor pacing code.

Member Function Documentation

◆ u_ls_ns_get_and_reset()

void u_ls_ns_get_and_reset ( struct u_live_stats_ns uls,
uint64_t *  out_median,
uint64_t *  out_mean,
uint64_t *  out_worst 
)

Get the median, mean and worst of the current set of values, then reset the struct.

References value_count, and values.

Referenced by u_ls_ns_print_and_reset().

◆ u_ls_ns_print_and_reset()

void u_ls_ns_print_and_reset ( struct u_live_stats_ns uls,
u_pp_delegate_t  dg 
)

Prints the calculated values and resets the struct, can be used with u_ls_ns_print_header to get a nice header to the values.

Doesn't include any newlines.

References name, u_ls_ns_get_and_reset(), and u_pp().

◆ u_ls_ns_print_header()

void u_ls_ns_print_header ( u_pp_delegate_t  dg)

Prints a header that looks nice before u_ls_ns_print_and_reset, adding details about columns.

Doesn't include any newlines.

References u_pp().

Field Documentation

◆ name

◆ value_count

uint32_t u_live_stats_ns::value_count

Number of values currently in struct.

Referenced by u_ls_ns_add(), and u_ls_ns_get_and_reset().

◆ values

uint64_t u_live_stats_ns::values[(1024)]

The values that will be used to calculate statistics.

Referenced by u_ls_ns_add(), and u_ls_ns_get_and_reset().


The documentation for this struct was generated from the following file: