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

Websockets and externalization of histogram code into libcircllhist #278

Merged
merged 9 commits into from
Jul 22, 2016

Conversation

rileyberton
Copy link
Contributor

This requires --enable-wslay support in libmtev. And it requires a package for libcircllhist (https://github.com/circonus-labs/libcircllhist).

This allows you to connect a websocket to http(s)://<broker>/livestream and send down a request for data like:

                          var check = {
                              "period_ms": 500,
                              "check_uuid": "f7cea020-f19d-11dd-85a6-cb6d3a2207dc",
                              "metrics" : ["check_cnt", "checks_run"]
                          };
                          var string = JSON.stringify(check);
                          connection.sendUTF(string);

And you will get back individual livestreamed metrics at period_ms which are filtered to the names in metrics. You can get all metrics under that check by omitting the metrics field from the request.

@postwait
Copy link
Member

postwait commented Jul 6, 2016

This looks good to me.

@esproul
Copy link
Member

esproul commented Jul 21, 2016

Tested a build from this branch and found that a couple additional binaries are linking libcircllhist, in addition to the expected histogram.so module:

  • noitd: not surprising, hist_* functions used in noit_metric.c.
  • postgres.so: Cannot see why this one is linking libcircllhist as it references none of its functions. Appears to be a direct linkage, i.e., not an indirect dependency.

Neither of these are show-stoppers; they are simply unexpected (at least by me). The postgres module is the more perplexing.

@esproul
Copy link
Member

esproul commented Jul 21, 2016

I get this error building on EL6:

- compiling noit_metric.c
In file included from noit_metric.c:1:
noit_metric.h:82: error: expected specifier-qualifier-list before 'uint64_t'
noit_metric.c: In function 'noit_metric_to_json':
noit_metric.c:23: error: 'noit_metric_value_t' has no member named 'whence_ms'
noit_metric.c:31: error: 'noit_metric_value_t' has no member named 'type'
noit_metric.c:31: error: 'noit_metric_value_t' has no member named 'type'
noit_metric.c:35: error: 'noit_metric_value_t' has no member named 'type'
noit_metric.c:43: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:45: error: 'noit_metric_value_t' has no member named 'type'
noit_metric.c:53: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:59: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:65: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:71: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:76: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:102: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:102: error: 'noit_metric_value_t' has no member named 'value'
noit_metric.c:109: error: 'uint64_t' undeclared (first use in this function)
noit_metric.c:109: error: (Each undeclared identifier is reported only once
noit_metric.c:109: error: for each function it appears in.)
noit_metric.c:109: error: expected ';' before 'bc'
noit_metric.c:110: error: 'bc' undeclared (first use in this function)
make[1]: *** [noit_metric.o] Error 1

@esproul
Copy link
Member

esproul commented Jul 21, 2016

Builds correctly on Circonus-supported platforms. LGTM.

@rileyberton rileyberton merged commit e777c36 into master Jul 22, 2016
@postwait postwait deleted the websockets branch June 14, 2018 17:58
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.

5 participants