Skip to content

Commit

Permalink
Add app->collectd variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzigold committed Aug 29, 2023
1 parent e36da25 commit 0f06813
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions generator/amqp_snd_th.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ static void gen_mesg(pn_rwbytes_t *buf, app_data_t *app, char *time_buf) {
buf->start = build_log_mesg(app, time_buf);
} else if (app->ceilometer) {
buf->start = build_ceil_mesg(app, time_buf);
} else {
} else if (app->collectd){
buf->start = build_metric_mesg(app, time_buf);
}
} else {
buf->start = NULL;
}

if (buf->start != NULL)
buf->size = strlen(buf->start);
Expand Down
4 changes: 2 additions & 2 deletions generator/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ int main(int argc, char **argv) {
app.presettled = false;
app.logs = false;
app.ceilometer = false;
app.collectd = true;

int num_threads = 1;

Expand Down Expand Up @@ -150,8 +151,7 @@ int main(int argc, char **argv) {
break;
case 'g':
if (!strcmp(optarg, "collectd")) {
// used by default
break;
app.collectd = true;
} else if (!strcmp(optarg, "ceilometer")) {
app.ceilometer = true;
} else if (!strcmp(optarg, "rsyslog")) {
Expand Down
1 change: 1 addition & 0 deletions generator/gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ typedef struct {
int metrics_per_second;
int logs;
int ceilometer;
int collectd;

pthread_t amqp_snd_th;

Expand Down

0 comments on commit 0f06813

Please sign in to comment.