Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #8 Histogram Library and Ping Pong Latency functionality #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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