Skip to content

Commit

Permalink
CLEANUP: Refactor includes
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesecrust committed Oct 23, 2024
1 parent 477fd2c commit 9e33576
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions lqdetect.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "lqdetect.h"

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <pthread.h>
#include <sys/time.h>
#include <assert.h>
#include <memcached/util.h>

#include "lqdetect.h"
#include "memcached/util.h"
#include "memcached/extension_loggers.h"

#define LQ_THRESHOLD_DEFAULT 4000
#define LQ_QUERY_SIZE (64*2+64) /* bop get (longest query) : "<longest bkey>..<longest bkey> efilter <offset> <count> delete" */
Expand Down Expand Up @@ -221,9 +221,9 @@ static int do_make_bkeystring(char *buffer, const bkey_range *bkrange, const efl
}

/* external functions */
int lqdetect_init(EXTENSION_LOGGER_DESCRIPTOR *logger)
int lqdetect_init(void *logger)
{
mc_logger = logger;
mc_logger = (EXTENSION_LOGGER_DESCRIPTOR*)logger;
pthread_mutex_init(&lqdetect.lock, NULL);
lqdetect_in_use = false;

Expand Down
8 changes: 5 additions & 3 deletions lqdetect.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#ifndef LQDETECT_H
#define LQDETECT_H

#include "memcached/extension_loggers.h"
#include "memcached/util.h"
#include <stdbool.h>
#include <stdint.h>

#include "memcached/types.h"

#define DETECT_LONG_QUERY

extern bool lqdetect_in_use;

int lqdetect_init(EXTENSION_LOGGER_DESCRIPTOR *logger);
int lqdetect_init(void *logger);
void lqdetect_final(void);
char *lqdetect_result_get(int *size);
int lqdetect_start(uint32_t threshold, bool *already_started);
Expand Down
1 change: 1 addition & 0 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include <stdarg.h>
#include <stddef.h>

#include "lqdetect.h"

/* Lock for global stats */
static pthread_mutex_t stats_lock = PTHREAD_MUTEX_INITIALIZER;
Expand Down
1 change: 0 additions & 1 deletion memcached.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "topkeys.h"
#include "mc_util.h"
#include "cmdlog.h"
#include "lqdetect.h"
#include "engine_loader.h"
#include "sasl_defs.h"

Expand Down

0 comments on commit 9e33576

Please sign in to comment.