Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
logstash-forwarder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LaaS
logstash-forwarder
Commits
d4b1e13b
Commit
d4b1e13b
authored
Sep 07, 2012
by
Jordan Sissel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move sleep min/max defs to a header
parent
d3375db7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
27 deletions
+26
-27
Makefile
Makefile
+18
-20
emitter.c
emitter.c
+1
-2
harvester.c
harvester.c
+1
-3
proto.c
proto.c
+1
-2
sleepdefs.h
sleepdefs.h
+5
-0
No files found.
Makefile
View file @
d4b1e13b
...
...
@@ -49,39 +49,40 @@ rpm deb: | build-all
# install -d -m 755 build/bin/* $(PREFIX)/bin/lumberjack
# install -d build/lib/* $(PREFIX)/lib
backoff.c
:
backoff.h
harvester.c
:
harvester.h proto.h str.h
emitter.c
:
emitter.h ring.h
lumberjack.c
:
backoff.h harvester.h emitter.h
str.c
:
str.h
proto.c
:
proto.h str.h
ring.c
:
ring.h
harvester.c
:
build/include/insist.h
lumberjack.c
:
build/include/insist.h
backoff.o
:
backoff.c backoff.h
harvester.o
:
harvester.c harvester.h proto.h str.h sleepdefs.h
emitter.o
:
emitter.c emitter.h ring.h sleepdefs.h
lumberjack.o
:
lumberjack.c backoff.h harvester.h emitter.h
str.o
:
str.c str.h
proto.o
:
proto.c proto.h str.h sleepdefs.h
ring.o
:
ring.c ring.h
harvester.o
:
build/include/insist.h
lumberjack.o
:
build/include/insist.h
# Vendor'd dependencies
# If VENDOR contains 'zeromq' download and build it.
ifeq
($(filter zeromq,$(VENDOR)),zeromq)
emitter.
c
:
build/include/zmq.h
harvester.
c
:
build/include/zmq.h
lumberjack.
c
:
build/include/zmq.h
emitter.
o
:
build/include/zmq.h
harvester.
o
:
build/include/zmq.h
lumberjack.
o
:
build/include/zmq.h
build/bin/lumberjack
:
| build/bin build/lib/libzmq.$(LIBEXT)
endif
# zeromq
ifeq
($(filter jemalloc,$(VENDOR)),jemalloc)
harvester.
c lumberjack.c ring.c str.c
:
build/include/jemalloc/jemalloc.h
harvester.
o lumberjack.o ring.o str.o
:
build/include/jemalloc/jemalloc.h
build/bin/lumberjack
:
| build/lib/libjemalloc.$(LIBEXT)
endif
# jemalloc
ifeq
($(filter openssl,$(VENDOR)),openssl)
proto.
c
:
build/include/openssl/ssl.h
lumberjack.
c
:
build/include/openssl/ssl.h
proto.
o
:
build/include/openssl/ssl.h
lumberjack.
o
:
build/include/openssl/ssl.h
build/bin/lumberjack
:
| build/lib/libssl.$(LIBEXT)
build/bin/lumberjack
:
| build/lib/libcrypto.$(LIBEXT)
endif
# openssl
ifeq
($(filter zlib,$(VENDOR)),zlib)
proto.
c
:
build/include/zlib.h
proto.
o
:
build/include/zlib.h
build/bin/lumberjack
:
| build/lib/libz.$(LIBEXT)
endif
# zlib
...
...
@@ -90,13 +91,10 @@ test: | build/test/test_ring
build/test/test_ring
# Tests
test_ring.
c
:
ring.h build/include/jemalloc/jemalloc.h build/include/insist.h
test_ring.
o
:
ring.h build/include/jemalloc/jemalloc.h build/include/insist.h
build/test/test_ring
:
test_ring.o ring.o | build/test
$(CC)
$(LDFLAGS)
-o
$@
$^
-ljemalloc
proto.o
:
proto.c
$(CC)
$(CFLAGS)
-c
-o
$@
$^
build/bin/lumberjack.sh
:
lumberjack.sh | build/bin
install
-m
755
$^
$@
...
...
emitter.c
View file @
d4b1e13b
...
...
@@ -12,8 +12,7 @@
#include <sys/resource.h>
static
struct
timespec
MIN_SLEEP
=
{
0
,
10000000
};
/* 10ms */
static
struct
timespec
MAX_SLEEP
=
{
15
,
0
};
/* 15 */
#include "sleepdefs.h"
void
*
emitter
(
void
*
arg
)
{
struct
emitter_config
*
config
=
arg
;
...
...
harvester.c
View file @
d4b1e13b
...
...
@@ -14,6 +14,7 @@
#include "harvester.h"
#include "backoff.h"
#include "insist.h"
#include "sleepdefs.h"
#ifdef __MACH__
/* OS X is dumb, or I am dumb, or we are both dumb. I don't know anymore,
...
...
@@ -26,9 +27,6 @@ extern int gethostname(char *name, size_t namelen);
#define EMITTER_SOCKET "inproc://emitter"
#define BUFFERSIZE 16384
static
struct
timespec
MIN_SLEEP
=
{
0
,
10000000
};
/* 10ms */
static
struct
timespec
MAX_SLEEP
=
{
15
,
0
};
/* 15 */
/* A free function that simply calls free(3) for zmq_msg */
//static inline void free2(void *data, void __attribute__((__unused__)) *hint) {
//free(data);
...
...
proto.c
View file @
d4b1e13b
...
...
@@ -20,8 +20,7 @@
#include "openssl/ssl.h"
#include "openssl/err.h"
static
struct
timespec
MIN_SLEEP
=
{
0
,
10000000
};
/* 10ms */
static
struct
timespec
MAX_SLEEP
=
{
15
,
0
};
/* 15 */
#include "sleepdefs.h"
static
void
lumberjack_init
(
void
);
static
int
lumberjack_tcp_connect
(
struct
lumberjack
*
lumberjack
);
...
...
sleepdefs.h
0 → 100644
View file @
d4b1e13b
#ifndef _SLEEPDEFS_H_
#define _SLEEPDEFS_H_
static
struct
timespec
MIN_SLEEP
=
{
0
,
10000000
};
/* 10ms */
static
struct
timespec
MAX_SLEEP
=
{
1
,
0
};
/* 15 */
#endif
/* _SLEEPDEFS_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment