in sample/log_producer_benchmark.c [232:260]
void log_producer_create_destroy()
{
int count = 0;
while (1)
{
if (log_producer_env_init(LOG_GLOBAL_ALL) != LOG_PRODUCER_OK) {
exit(1);
}
log_producer * producer = create_log_producer_wrapper(on_log_send_done);
if (producer == NULL)
{
printf("create log producer by config file fail \n");
exit(1);
}
log_producer_client * client = get_log_producer_client(producer, NULL);
if (client == NULL)
{
printf("create log producer client by config file fail \n");
exit(1);
}
destroy_log_producer(producer);
log_producer_env_destroy();
printf("%d \n", count++);
}
}