mirror of
https://github.com/schoebel/mars
synced 2025-01-30 11:51:54 +00:00
light: add statusfile_rollover
This commit is contained in:
parent
87631d14fc
commit
8490dcc7bc
2
mars.h
2
mars.h
@ -266,6 +266,8 @@ extern struct banning mars_global_ban;
|
||||
|
||||
extern atomic_t mars_global_io_flying;
|
||||
|
||||
extern int rollover_time;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Some special brick types for avoidance of cyclic references.
|
||||
|
@ -22,6 +22,8 @@ struct banning mars_global_ban = {};
|
||||
EXPORT_SYMBOL_GPL(mars_global_ban);
|
||||
atomic_t mars_global_io_flying = ATOMIC_INIT(0);
|
||||
EXPORT_SYMBOL_GPL(mars_global_io_flying);
|
||||
int rollover_time = 3;
|
||||
EXPORT_SYMBOL_GPL(rollover_time);
|
||||
|
||||
static char *id = NULL;
|
||||
|
||||
|
@ -3846,6 +3846,7 @@ static struct mars_global _global = {
|
||||
|
||||
static int light_thread(void *data)
|
||||
{
|
||||
long long last_rollover = jiffies;
|
||||
char *id = my_id();
|
||||
int status = 0;
|
||||
mars_global = &_global;
|
||||
@ -3924,7 +3925,10 @@ static int light_thread(void *data)
|
||||
status = mars_kill_brick_when_possible(&_global, &_global.server_anchor, false, (void*)&sio_brick_type, false);
|
||||
MARS_DBG("kill server sio bricks (when possible) = %d\n", status);
|
||||
|
||||
rollover_all();
|
||||
if ((long long)jiffies + rollover_time * HZ >= last_rollover) {
|
||||
last_rollover = jiffies;
|
||||
rollover_all();
|
||||
}
|
||||
|
||||
_show_status_all(&_global);
|
||||
#ifdef STAT_DEBUGGING
|
||||
|
@ -151,6 +151,7 @@ ctl_table mars_table[] = {
|
||||
INT_ENTRY("logger_mem_used_kb", trans_logger_mem_usage, 0400),
|
||||
INT_ENTRY("raw_mem_used_kb", brick_global_block_used,0400),
|
||||
INT_ENTRY("io_flying", mars_global_io_flying, 0400),
|
||||
INT_ENTRY("statusfiles_rollover", rollover_time, 0600),
|
||||
INT_ENTRY("logrot_auto_gb", global_logrot_auto, 0600),
|
||||
INT_ENTRY("logdel_auto_gb", global_logdel_auto, 0600),
|
||||
INT_ENTRY("free_space_mb", global_free_space, 0600),
|
||||
|
Loading…
Reference in New Issue
Block a user