print out each worker's total requests

worker_generates_requests_to_local_queue
Xiaosu Lyu 3 years ago
parent c07ebd310f
commit b2754acc30

@ -26,7 +26,7 @@
#define RUNTIME_MAX_EPOLL_EVENTS 128
#define RUNTIME_MAX_TENANT_COUNT 32
#define RUNTIME_RELATIVE_DEADLINE_US_MAX 3600000000 /* One Hour. Fits in uint32_t */
#define RUNTIME_RUNQUEUE_SIZE 256 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_RUNQUEUE_SIZE 102400 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_TENANT_QUEUE_SIZE 4096
enum RUNTIME_SIGALRM_HANDLER

@ -6,6 +6,7 @@
#include "local_runqueue.h"
thread_local uint32_t total_local_requests = 0;
static struct local_runqueue_config local_runqueue;
#ifdef LOG_LOCAL_RUNQUEUE
@ -27,6 +28,7 @@ void
local_runqueue_add(struct sandbox *sandbox)
{
assert(local_runqueue.add_fn != NULL);
total_local_requests++;
#ifdef LOG_LOCAL_RUNQUEUE
local_runqueue_count++;
#endif

@ -534,6 +534,5 @@ main(int argc, char **argv)
exit(-1);
}
}
exit(-1);
}

@ -35,6 +35,8 @@ thread_local _Atomic volatile sig_atomic_t deferred_sigalrm = 0;
extern pthread_t *runtime_worker_threads;
extern time_t t_start;
extern pthread_t listener_thread_id;
extern thread_local uint32_t total_local_requests;
extern thread_local int worker_thread_idx;
#ifdef SANDBOX_STATE_TOTALS
extern _Atomic uint32_t sandbox_state_totals[SANDBOX_STATE_COUNT];
@ -224,8 +226,9 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
double seconds = difftime(t_end, t_start);
double throughput = atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]) / seconds;
uint32_t total_sandboxes_error = atomic_load(&sandbox_state_totals[SANDBOX_ERROR]);
printf("throughput is %f, error request is %u\n", throughput, total_sandboxes_error);
exit(0);
printf("throughput is %f, error request is %u global total request %d time is %f worker %d total requests is %u\n", throughput, total_sandboxes_error, atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]), seconds, worker_thread_idx, total_local_requests);
fflush(stdout);
pthread_exit(0);
}
default: {
const char *signal_name = strsignal(signal_type);

Loading…
Cancel
Save