root/src/noit_jlog_listener.h

Revision 304ec80b8cf842fc0abe5f9029790908b6455957, 2.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 months ago)

Convert to libmtev.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  * Copyright (c) 2015, Circonus, Inc. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials provided
15  *       with the distribution.
16  *     * Neither the name OmniTI Computer Consulting, Inc. nor the names
17  *       of its contributors may be used to endorse or promote products
18  *       derived from this software without specific prior written
19  *       permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _NOIT_JLOG_LISTENER_H
35 #define _NOIT_JLOG_LISTENER_H
36
37 #include <mtev_defines.h>
38 #include <eventer/eventer.h>
39
40 #define NOIT_JLOG_DATA_FEED 0xda7afeed
41 #define NOIT_JLOG_DATA_TEMP_FEED 0x7e66feed
42
43 typedef struct {
44   char *feed_name;
45   mtev_atomic32_t connections;
46   struct timeval last_connection;
47   struct timeval last_checkpoint;
48 } jlog_feed_stats_t;
49
50 API_EXPORT(void)
51   noit_jlog_listener_init(void);
52
53 API_EXPORT(int)
54   noit_jlog_handler(eventer_t e, int mask, void *closure,
55                     struct timeval *now);
56
57 /* This API call is only safe from the eventer thread */
58 API_EXPORT(jlog_feed_stats_t *)
59   noit_jlog_feed_stats(const char *sub);
60
61 API_EXPORT(int)
62   noit_jlog_foreach_feed_stats(int (*f)(jlog_feed_stats_t *, void *),
63                                void *);
64
65 #endif
Note: See TracBrowser for help on using the browser.