Skip to content

Conversation

@akorzan
Copy link
Contributor

@akorzan akorzan commented Apr 6, 2015

I added to sockets/latency/latency-count.c the newly implement histogram library.

Logarithmic histogram would be preferable for such an application, but nonetheless a linear histogram is a worthwhile addition.

To create the histogram, simply include the header file found in util/hist.h.

Create and free functions are provided. The functions are rather self explanatory.

/* Creates and returns the histogram data structure */
struct histogram* histogram_create(int min, int max, int num_buckets)
/* Increments the respective bucket in the histogram */
void histogram_inc(struct histogram* hist, int data_point)
/* Prints the histogram to the console */
void histogram_print(struct histogram* hist)
/* Frees the histogram from memory */
void histogram_free(struct histogram* hist)

@twood02
Copy link
Member

twood02 commented Apr 7, 2015

be sure to update this to deal with the case where a user adds a value that is greater than the last bucket (line 38).

Also, you need to remove your binary file.

Post a comment after you update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants