Skip to content

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

Open
akorzan wants to merge 3 commits into
gwAdvNet2015:masterfrom
akorzan:akorzan_issue_8
Open

akorzan wants to merge 3 commits into
gwAdvNet2015:masterfrom
akorzan:akorzan_issue_8

Conversation

@akorzan

@akorzan akorzan commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

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

twood02 commented Apr 7, 2015

Copy link
Copy Markdown
Member

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