Changeset 2417a3262808d93c08cb01f0c7dfc7a7d40df766
- Timestamp:
- 06/14/12 16:02:57
(1 year ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1339689777 -0400
- git-parent:
[4496cc4e7850184a250647f0a956c335c15f5f18]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1339689777 -0400
- Message:
Allow livestreaming to attach to the non-transient check.
If a period of 0 is provided, just add this livestream as
a feed on the master check. It won't show up in watches, but
it acts like a normal watch.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4496cc4 |
r2417a32 |
|
| 594 | 594 | |
|---|
| 595 | 595 | uuid_unparse_lower(in, uuid_str); |
|---|
| | 596 | |
|---|
| | 597 | noitL(noit_error, "noit_check_watch(%s,%d)\n", uuid_str, period); |
|---|
| | 598 | if(period == 0) { |
|---|
| | 599 | return noit_poller_lookup(in); |
|---|
| | 600 | } |
|---|
| | 601 | |
|---|
| 596 | 602 | /* Find the check */ |
|---|
| 597 | 603 | snprintf(xpath, sizeof(xpath), "//checks//check[@uuid=\"%s\"]", uuid_str); |
|---|
| re88e9e3 |
r2417a32 |
|
| 534 | 534 | noit_check_state_string(c->state)); |
|---|
| 535 | 535 | nc_printf(ncct, " status: %s\n", c->status ? c->status : "[[null]]"); |
|---|
| | 536 | nc_printf(ncct, " feeds: %d\n", check->feeds ? check->feeds->size : 0); |
|---|
| 536 | 537 | nc_printf(ncct, " metrics:\n"); |
|---|
| 537 | 538 | memset(&iter, 0, sizeof(iter)); |
|---|
| r26d8ac6 |
r2417a32 |
|
| 53 | 53 | typedef struct { |
|---|
| 54 | 54 | u_int32_t period; |
|---|
| | 55 | noit_boolean period_read; |
|---|
| 55 | 56 | struct log_entry *lqueue; |
|---|
| 56 | 57 | struct log_entry *lqueue_end; |
|---|
| … | … | |
| 238 | 239 | /* Setup logger to this channel */ |
|---|
| 239 | 240 | noitL(noit_debug, "livestream initializing on fd %d\n", e->fd); |
|---|
| 240 | | if(!jcl->period) { |
|---|
| | 241 | if(!jcl->period_read) { |
|---|
| 241 | 242 | u_int32_t nperiod; |
|---|
| 242 | 243 | len = e->opset->read(e->fd, &nperiod, sizeof(nperiod), &mask, e); |
|---|
| … | … | |
| 244 | 245 | if(len != sizeof(nperiod)) goto socket_error; |
|---|
| 245 | 246 | jcl->period = ntohl(nperiod); |
|---|
| 246 | | if(!jcl->period) { |
|---|
| 247 | | noitL(noit_error, "period of 0 specified in livestream. not allowed.\n"); |
|---|
| 248 | | goto socket_error; |
|---|
| 249 | | } |
|---|
| | 247 | jcl->period_read = noit_true; |
|---|
| 250 | 248 | noitL(noit_debug, "livestream initializing on fd %d [period %d]\n", |
|---|
| 251 | 249 | e->fd, jcl->period); |
|---|